Re: Why *not* use UNIVERSAL qw( isa can ) ; ??
[p5sagit/p5-mst-13.2.git] / t / op / split.t
index 8aa91e5..f9c3bb9 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..44\n";
+print "1..46\n";
 
 $FS = ':';
 
@@ -244,3 +244,24 @@ print "ok 32\n";
     print "ok 44\n";
 }
 
+{
+    # check that PMf_WHITE is cleared after \s+ is used
+    # reported in <20010627113312.RWGY6087.viemta06@localhost>
+    my $r;
+    foreach my $pat ( qr/\s+/, qr/ll/ ) {
+       $r = join ':' => split($pat, "hello cruel world");
+    }
+    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";
+}