X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F004_list_compressions.t;h=4721dfacdef1fa6716f36c45e03b5d85afd0b5c9;hb=e1e26b55f53e781d6096f6ae520363d38344d88b;hp=d97775f8f6f1f423408518de59f8f29dd47ca5d3;hpb=252ab1a26175a028754adbe4589cd87bc5240ce6;p=gitmo%2FMoose-Autobox.git diff --git a/t/004_list_compressions.t b/t/004_list_compressions.t index d97775f..4721dfa 100644 --- a/t/004_list_compressions.t +++ b/t/004_list_compressions.t @@ -3,13 +3,13 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::More tests => 5; BEGIN { use_ok('Moose::Autobox'); } -use autobox; +use Moose::Autobox; is_deeply( [ 1 .. 5 ]->map(sub { $_ * $_ }), @@ -19,4 +19,20 @@ is_deeply( is_deeply( [ 1 .. 5 ]->map(sub { $_ * $_ })->do(sub { $_->zip($_) }), [ [1, 1], [4, 4], [9, 9], [16, 16], [25, 25] ], -'... got the expected return values'); \ No newline at end of file +'... got the expected return values'); + +is( # sprintf an array ... +[ 1 .. 5 ]->sprintf("%d -> %d -> %d"), +'1 -> 2 -> 3', +'... got the sprintf-ed values'); + +is( # sprintf an array ... +[ 1 .. 5 ]->do(sub { + $_->sprintf( + $_->keys + ->map(sub { '%d (' . $_ . ')' }) + ->join(' -> ')) +}), +'1 (0) -> 2 (1) -> 3 (2) -> 4 (3) -> 5 (4)', +'... got a more elaboratly sprintf-ed values'); +