add test for split without a pattern
authorGerard Goossen <gerard@ggoossen.net>
Tue, 21 Dec 2010 12:55:19 +0000 (13:55 +0100)
committerZefram <zefram@fysh.org>
Sat, 8 Jan 2011 13:38:39 +0000 (13:38 +0000)
t/op/split.t

index 6e98078..c667a3d 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 251;
+plan tests => 252;
 
 $FS = ':';
 
@@ -73,6 +73,11 @@ is($_ , '1:2:3:4:5:6:::');
 $cnt = split(/:/,'1:2:3:4:5:6:::', 999);
 is($cnt, scalar(@ary));
 
+# Splitting without pattern
+$_ = "1 2 3 4";
+$_ = join(':', split);
+is($_ , '1:2:3:4');
+
 # Does assignment to a list imply split to one more field than that?
 $foo = runperl( switches => ['-Dt'], stderr => 1, prog => '($a,$b)=split;' );
 ok($foo =~ /DEBUGGING/ || $foo =~ /const\n?\Q(IV(3))\E/);