From: Gerard Goossen Date: Tue, 21 Dec 2010 12:55:19 +0000 (+0100) Subject: add test for split without a pattern X-Git-Tag: accepted/trunk/20130322.191538~6196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a720890cfcdb8354a4cdb3aa4c7c71da950da59f;p=platform%2Fupstream%2Fperl.git add test for split without a pattern --- diff --git a/t/op/split.t b/t/op/split.t index 6e98078..c667a3d 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/);