Skip to content

Commit

Permalink
Add tests for .map(*) and map(*,...)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 2, 2014
1 parent 8acb632 commit 8552051
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion S32-list/map.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 53;
plan 59;

# L<S32::Containers/"List"/"=item map">

Expand All @@ -13,6 +13,20 @@ plan 53;

my @list = (1 .. 5);

#?pugs skip 'NYI'
#?niecza skip 'NYI'
{
my Int $s;
my Str @a;
my Num %h;
ok $s === $s.map(*), 'is $s.map(*) a noop';
ok $s === map(*,$s), 'is map(*,$s) a noop';
ok @a === @a.map(*), 'is @a.map(*) a noop';
ok @a === map(*,@a), 'is map(*,@a) a noop';
ok %h === %h.map(*), 'is %h.map(*) a noop';
ok %h === map(*,%h), 'is map(*,%h) a noop';
}

{
my @result = map { $_ * 2 }, @list;
is(+@result, 5, 'sub form: we got a list back');
Expand Down

0 comments on commit 8552051

Please sign in to comment.