X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Leaner.git;a=blobdiff_plain;f=t%2F26-is_deeply.t;h=d4550409f41cb36e6be0b74c411a00f4b4291c0f;hp=0d6b84c9e565f28b5db11dab390ce908f9c0c742;hb=0db3dd7d4fcdcb1161ed596c1582206245e81cca;hpb=7b053442294016a9ce8e27a3bd424a4a6f829862 diff --git a/t/26-is_deeply.t b/t/26-is_deeply.t index 0d6b84c..d455040 100644 --- a/t/26-is_deeply.t +++ b/t/26-is_deeply.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::Leaner tests => 21 + 2 + 1; +use Test::Leaner tests => 21 + 2 + 1 + 2; my $lacunary = [ [ 1, 2, 3 ] => [ 1, 2, 3 ] ]; delete $lacunary->[0]->[1]; @@ -100,3 +100,13 @@ push @tests, [ map Test::Leaner::TestIsDeeplyOverload->new('foo'), 1 .. 2 ]; for my $t (@tests) { is_deeply $t->[0], $t->[1]; } + +# Test vivification of deleted elements of an array + +{ + my @l = (1); + $l[2] = 3; + is_deeply \@l, [ 1, undef, 3 ]; + delete $l[2]; + is_deeply \@l, [ 1 ]; +}