Skip to content

Commit

Permalink
[t/spec] extended and corrected pick.t
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@27520 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Jul 12, 2009
1 parent 18e525c commit dab2551
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions S32-list/pick.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 16;
plan 17;

=begin description
Expand Down Expand Up @@ -66,7 +66,13 @@ ok +@value == $c && $c, 'pick(*, :repl) is lazy';

{
# Test that List.pick doesn't flatten array refs
ok ?([[1, 2], [3, 4]].pick.[0].join('|') eq any('1|2', '3|4')), '[[1,2],[3,4]].pick does not flatten';
ok ?([[1, 2], [3, 4]].pick.join('|') eq any('1|2', '3|4')), '[[1,2],[3,4]].pick does not flatten';
ok ?(~([[1, 2], [3, 4]].pick(*)) eq '1 2 3 4' | '3 4 1 2'), '[[1,2],[3,4]].pick(*) does not flatten';
}

{
ok <5 5>.pick() == 5,
'.pick() returns something can be used as single scalar';
}

# vim: ft=perl6

0 comments on commit dab2551

Please sign in to comment.