1use Test::More qw(no_plan); 2use strict; 3use warnings; 4 5use autobox::Core; 6 7my @array = qw(foo bar); 8 9my @returned = @array->unshift('baz'); 10 11is_deeply \@array, [qw(baz foo bar)]; 12is_deeply \@returned, [qw(baz foo bar)]; 13 14my $arrayref = @array->unshift('baz'); 15 16is ref $arrayref, 'ARRAY', "Returns arrayref in scalar context"; 17 18my $array = [qw(foo bar)]; 19 20$array->unshift('baz'); 21 22is_deeply $array, [qw(baz foo bar)]; 23 24