Add test for modify-in-place usage of ->map, as well as an example in the pod docs.
[gitmo/Moose-Autobox.git] / t / 001_basic.t
index 7ee4b93..4c18e6f 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 68;
+use Test::More tests => 69;
 
 BEGIN {
     use_ok('Moose::Autobox');
@@ -75,6 +75,10 @@ $a->map(sub { $_ + 2 }),
 
 is_deeply($a, [ 4, 2, 6, 78, 101, 2, 3 ], '... original value is unchanged');
 
+my $b = [1, 2, 3];
+$b->map(sub { $_++ } );
+is_deeply($b, [ 2, 3, 4 ], '... original value is changed');
+
 is_deeply(
 $a->reverse(),
 [ 3, 2, 101, 78, 6, 2, 4 ],