In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/98ca8b423e7ba2fdcb24c91d0a5b0b529b6a04b9?hp=f5cf236ddbe8e24ed7acd5f0f961253d1500fac3>
- Log ----------------------------------------------------------------- commit 98ca8b423e7ba2fdcb24c91d0a5b0b529b6a04b9 Author: James E Keenan <[email protected]> Date: Sun Mar 3 14:32:13 2013 -0500 Add NY Perl Hackathon participant to AUTHORS. M AUTHORS commit acb447f448c124eb0f430115bf56265003212ace Author: Andrew Tam <[email protected]> Date: Sat Mar 2 16:13:48 2013 -0500 Added descriptions to tests lacking them. M t/op/split.t ----------------------------------------------------------------------- Summary of changes: AUTHORS | 1 + t/op/split.t | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index a578d0f..1b09934 100644 --- a/AUTHORS +++ b/AUTHORS @@ -85,6 +85,7 @@ Andrew M. Langmead <[email protected]> Andrew Pimlott <[email protected]> Andrew Rodland <[email protected]> Andrew Savige <[email protected]> +Andrew Tam <[email protected]> Andrew Vignaux <[email protected]> Andrew Wilcox <[email protected]> Andrey Sapozhnikov <[email protected]> diff --git a/t/op/split.t b/t/op/split.t index 47bd8e6..c198737 100644 --- a/t/op/split.t +++ b/t/op/split.t @@ -14,7 +14,7 @@ $_ = 'a:b:c'; ($a,$b,$c) = split($FS,$_); -is(join(';',$a,$b,$c), 'a;b;c'); +is(join(';',$a,$b,$c), 'a;b;c', 'Split a simple string into scalars.'); @ary = split(/:b:/); $cnt = split(/:b:/); @@ -53,18 +53,18 @@ is($cnt, scalar(@ary)); # Can we say how many fields to split to? $_ = join(':', split(' ','1 2 3 4 5 6', 3)); -is($_, '1:2:3 4 5 6'); +is($_, '1:2:3 4 5 6', "Split into a specified number of fields, defined by a literal"); @ary = split(' ','1 2 3 4 5 6', 3); $cnt = split(' ','1 2 3 4 5 6', 3); -is($cnt, scalar(@ary)); +is($cnt, scalar(@ary), "Check element count from previous test"); # Can we do it as a variable? $x = 4; $_ = join(':', split(' ','1 2 3 4 5 6', $x)); -is($_, '1:2:3:4 5 6'); +is($_, '1:2:3:4 5 6', "Split into a specified number of fields, defined by a scalar variable"); @ary = split(' ','1 2 3 4 5 6', $x); $cnt = split(' ','1 2 3 4 5 6', $x); -is($cnt, scalar(@ary)); +is($cnt, scalar(@ary), "Check element count from previous test"); # Does the 999 suppress null field chopping? $_ = join(':', split(/:/,'1:2:3:4:5:6:::', 999)); @@ -76,7 +76,7 @@ is($cnt, scalar(@ary)); # Splitting without pattern $_ = "1 2 3 4"; $_ = join(':', split); -is($_ , '1:2:3:4'); +is($_ , '1:2:3:4', "Split and join without specifying a split pattern"); # Does assignment to a list imply split to one more field than that? $foo = runperl( switches => ['-Dt'], stderr => 1, prog => '($a,$b)=split;' ); @@ -85,7 +85,7 @@ ok($foo =~ /DEBUGGING/ || $foo =~ /const\n?\Q(IV(3))\E/); # Can we say how many fields to split to when assigning to a list? ($a,$b) = split(' ','1 2 3 4 5 6', 2); $_ = join(':',$a,$b); -is($_, '1:2 3 4 5 6'); +is($_, '1:2 3 4 5 6', "Storing split output into list of scalars"); # do subpatterns generate additional fields (without trailing nulls)? $_ = join '|', split(/,|(-)/, "1-10,20,,,"); -- Perl5 Master Repository
