Commit | Line | Data |
---|---|---|
30715849 | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use Test::More tests => 2; | |
7 | use Moose::Autobox; | |
8 | ||
9 | my $array = [ qw(1 2 3 4 ) ]; | |
10 | is_deeply( | |
11 | [ $array->flatten ], | |
12 | [ 1, 2, 3, 4 ], | |
13 | "flattening an array returns a list", | |
14 | ); | |
15 | ||
16 | my $hash = { a => 1, b => 2 }; | |
17 | is_deeply( | |
18 | [ sort $hash->flatten ], | |
19 | [ qw(1 2 a b) ], | |
20 | "flattening a hash returns a list", | |
21 | ); |