diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2007-01-20 07:21:48 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-25 17:22:40 +0000 |
commit | ede8ac17cc8980652fa00e4d3b33ce031d6bbd24 (patch) | |
tree | 46623126a9b3540c838a485c2ae6bd03c273f440 /t | |
parent | 6ebc233ed33de510dfa9becc9d8efa75c8d25d33 (diff) | |
download | perl-ede8ac17cc8980652fa00e4d3b33ce031d6bbd24.tar.gz |
split by " \0" (const string staring with a SPACE followed by NULL)
Message-Id: <20070119221905.D162.BQW10602@nifty.com>
p4raw-id: //depot/perl@29975
Diffstat (limited to 't')
-rwxr-xr-x | t/op/split.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/split.t b/t/op/split.t index b6d757043a..025327f385 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 130; +plan tests => 135; $FS = ':'; @@ -347,3 +347,14 @@ ok(@ary == 3 && ok(@r3 == 3 && join('-', @r3) eq "-:A:-:B", "$msg - /\\s+/ No.2"); } } + +{ + my $src = "ABC \0 FOO \0 XYZ"; + my @s = split(" \0 ", $src); + my @r = split(/ \0 /, $src); + is(scalar(@s), 3); + is($s[0], "ABC"); + is($s[1], "FOO"); + is($s[2]," XYZ"); + is(join(':',@s), join(':',@r)); +} |