Add test for modify-in-place usage of ->map, as well as an example in the pod docs.
[gitmo/Moose-Autobox.git] / t / 008_flatten.t
CommitLineData
30715849 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7use Moose::Autobox;
8
9my $array = [ qw(1 2 3 4 ) ];
10is_deeply(
11 [ $array->flatten ],
12 [ 1, 2, 3, 4 ],
13 "flattening an array returns a list",
14);
15
16my $hash = { a => 1, b => 2 };
17is_deeply(
18 [ sort $hash->flatten ],
19 [ qw(1 2 a b) ],
20 "flattening a hash returns a list",
21);