6 use Test::More tests => 4;
11 [ 1 .. 5 ]->map(sub { $_ * $_ }),
13 '... got the expected return values');
16 [ 1 .. 5 ]->map(sub { $_ * $_ })->do(sub { $_->zip($_) }),
17 [ [1, 1], [4, 4], [9, 9], [16, 16], [25, 25] ],
18 '... got the expected return values');
20 is( # sprintf an array ...
21 [ 1 .. 5 ]->sprintf("%d -> %d -> %d"),
23 '... got the sprintf-ed values');
25 is( # sprintf an array ...
29 ->map(sub { '%d (' . $_ . ')' })
32 '1 (0) -> 2 (1) -> 3 (2) -> 4 (3) -> 5 (4)',
33 '... got a more elaboratly sprintf-ed values');