X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Leaner.git;a=blobdiff_plain;f=t%2F26-is_deeply.t;h=d4da1dc280afe70cf431ec3453332ed900137b07;hp=0d6b84c9e565f28b5db11dab390ce908f9c0c742;hb=653bd706f7c17c61e34d98e6fcaed75861b2f7d7;hpb=465440ff9c9519d5ce33d582cbf3fa4d03b4358a diff --git a/t/26-is_deeply.t b/t/26-is_deeply.t index 0d6b84c..d4da1dc 100644 --- a/t/26-is_deeply.t +++ b/t/26-is_deeply.t @@ -3,7 +3,9 @@ use strict; use warnings; -use Test::Leaner tests => 21 + 2 + 1; +BEGIN { delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE} } + +use Test::Leaner tests => 21 + 2 + 1 + 2; my $lacunary = [ [ 1, 2, 3 ] => [ 1, 2, 3 ] ]; delete $lacunary->[0]->[1]; @@ -100,3 +102,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 ]; +}