Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

13 lines (8 sloc) 0.348 kB
#!/usr/bin/perl
use perl5i::latest;
use Test::More;
my @array = (4,5,6);
is_deeply [@array->map(sub { $_[0] + 1 })], [5,6,7], "map in list context";
is_deeply scalar @array->map(sub { $_[0] + 1 }), [5,6,7], "map in scalar context";
is_deeply [@array->map( func($item) { $item + 1 } )], [5,6,7], "map with named arguments";
done_testing();
Jump to Line
Something went wrong with that request. Please try again.