summaryrefslogtreecommitdiff
path: root/t/op/split.t
diff options
context:
space:
mode:
authorJeff Pinyan <japhy@pobox.com>2001-07-27 10:00:37 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-29 16:28:45 +0000
commit6de678708ca27d8ff9604030551fb53b27f5c5be (patch)
treea26575b52846895de3b65d8cee0b1ca6e83d41b4 /t/op/split.t
parent0926d669f0aeb90483227aeb54b96aaa4edee0f3 (diff)
downloadperl-6de678708ca27d8ff9604030551fb53b27f5c5be.tar.gz
split()'s unused captures should be undef, not ''
Message-ID: <Pine.GSO.4.21.0107271358310.28213-100000@crusoe.crusoe.net> p4raw-id: //depot/perl@11475
Diffstat (limited to 't/op/split.t')
-rwxr-xr-xt/op/split.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/split.t b/t/op/split.t
index 170dfe82d5..f9c3bb981b 100755
--- a/t/op/split.t
+++ b/t/op/split.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..45\n";
+print "1..46\n";
$FS = ':';
@@ -254,3 +254,14 @@ print "ok 32\n";
print "not " unless $r eq "he:o cruel world";
print "ok 45\n";
}
+
+
+{
+ # split /(A)|B/, "1B2" should return (1, undef, 2)
+ my @x = split /(A)|B/, "1B2";
+ print "not " unless
+ $x[0] eq '1' and
+ (not defined $x[1]) and
+ $x[2] eq '2';
+ print "ok 46\n";
+}