Skip to content

Commit

Permalink
[t/spec] RT #75900
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@31903 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Aug 4, 2010
1 parent 38b5f63 commit 9f54ff7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S06-signature/unpack-array.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 11;
plan 13;

# L<S06/Unpacking array parameters>

Expand Down Expand Up @@ -36,4 +36,19 @@ sub blat ($x, @a [$a, *@b]) {
is blat( 1, [2,3,4] ), "2|3|4", 'unpack named array';
is blat( 2, [2,3,4] ), "2-3-4", 'unpack named array with named pieces';

# RT #75900
{
my @my-array = 4,2,3,4;

sub fsort-only([$p?,*@r]) {
return fsort-only(@r.grep( {$_ <= $p} )),$p,fsort-only(@r.grep( {$_ > $p} )) if $p || @r;
}
sub fsort-multi([$p?,*@r]) {
return fsort-multi(@r.grep( {$_ <= $p} )),$p,fsort-multi(@r.grep( {$_ > $p} )) if $p || @r;
}

is fsort-only(@my-array).join(' '), '2 3 4 4', 'array unpacking and only-subs';
is fsort-multi(@my-array).join(' '), '2 3 4 4', 'array unpacking and only-multi';
}

# vim: ft=perl6

0 comments on commit 9f54ff7

Please sign in to comment.