d97775f8f6f1f423408518de59f8f29dd47ca5d3
[gitmo/Moose-Autobox.git] / t / 004_list_compressions.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 3;
7
8 BEGIN {
9     use_ok('Moose::Autobox');
10 }
11
12 use autobox;
13
14 is_deeply(
15 [ 1 .. 5 ]->map(sub { $_ * $_ }),
16 [ 1, 4, 9, 16, 25 ],
17 '... got the expected return values');
18
19 is_deeply(
20 [ 1 .. 5 ]->map(sub { $_ * $_ })->do(sub { $_->zip($_) }),
21 [ [1, 1], [4, 4], [9, 9], [16, 16], [25, 25] ],
22 '... got the expected return values');