summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGerard Goossen <gerard@ggoossen.net>2010-12-21 13:55:19 +0100
committerZefram <zefram@fysh.org>2011-01-08 13:38:39 +0000
commita720890cfcdb8354a4cdb3aa4c7c71da950da59f (patch)
tree629ffe94e693e05d5d0654e74cd630ca9145d365 /t
parent5e17f11b6866c2782e630759465df4d324d3844b (diff)
downloadperl-a720890cfcdb8354a4cdb3aa4c7c71da950da59f.tar.gz
add test for split without a pattern
Diffstat (limited to 't')
-rw-r--r--t/op/split.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/split.t b/t/op/split.t
index 6e980784ba..c667a3d961 100644
--- a/t/op/split.t
+++ b/t/op/split.t
@@ -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/);