From: Ricardo SIGNES Date: Mon, 12 May 2008 14:03:24 +0000 (+0000) Subject: tests for flatten, to return a "perl 5" list X-Git-Tag: 0_09~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=307158490a11ea8eb31739ab725d8fede9072cfb;p=gitmo%2FMoose-Autobox.git tests for flatten, to return a "perl 5" list --- diff --git a/t/008_flatten.t b/t/008_flatten.t new file mode 100644 index 0000000..bc52233 --- /dev/null +++ b/t/008_flatten.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 2; +use Moose::Autobox; + +my $array = [ qw(1 2 3 4 ) ]; +is_deeply( + [ $array->flatten ], + [ 1, 2, 3, 4 ], + "flattening an array returns a list", +); + +my $hash = { a => 1, b => 2 }; +is_deeply( + [ sort $hash->flatten ], + [ qw(1 2 a b) ], + "flattening a hash returns a list", +);