Skip to content

Commit

Permalink
Test appending to array with non-numeric subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Oct 16, 2011
1 parent a8d226e commit 56e3c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions t/merge-hash.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ is_deeply
{ -shot => 'gun', season => [qw(looney duck wabbit fudd)] },
'convert previous string to array ref as specified';

is_deeply
$slicer->merge([Hunting2 => 'X::Hunting' => { -shot => 'gun', season => ['looney'] }])->[2],
{ -shot => 'gun', season => [qw(looney wabbit bunny bird duck zombie)] },
'merge arrayref in order';

is_deeply
$slicer->merge([Plug => 'X::Plug' => { attr => [qw(ibute)] }])->[2],
{ attr => [qw(ibute pa)] },
Expand Down
3 changes: 2 additions & 1 deletion t/slice.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ my $slicer = new_ok($mod, [{
'Hunting2.season[1.10]' => 'bird',
'Hunting2.season[1.08]' => 'wabbit',
'Hunting2.season[1.11]' => 'duck',
'Hunting2.season[z]' => 'zombie',
},
}]);

Expand Down Expand Up @@ -47,7 +48,7 @@ is_deeply

is_deeply
$slicer->slice([Hunting2 => 'X::Hunting' => {}]),
{ season => [qw(wabbit bunny bird duck)] },
{ season => [qw(wabbit bunny bird duck zombie)] },
'received array ref containing all items';

done_testing;

0 comments on commit 56e3c2b

Please sign in to comment.