6 BEGIN { delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE} }
8 use Test::Leaner tests => 21 + 2 + 1 + 2;
10 my $lacunary = [ [ 1, 2, 3 ] => [ 1, 2, 3 ] ];
11 delete $lacunary->[0]->[1];
12 $lacunary->[1]->[1] = undef;
17 my $code_ref = sub { };
28 [ \(\'a') => \(\'a') ],
31 [ [ 'a' ] => [ 'a' ] ],
34 [ [ 1, 2, 3 ] => [ 1, 2, 3 ] ],
35 [ [ 1, undef, 3 ] => [ 1, undef, 3 ] ],
38 [ { a => 1 } => { a => 1 } ],
39 [ { a => undef } => { a => undef } ],
40 [ { a => \1 } => { a => \1 } ],
42 [ { a => [ 1, undef, 2 ], b => \3 } => { a => [ 1, undef, 2 ], b => \3 } ],
44 [ $scalar_ref => $scalar_ref ],
45 [ $array_ref => $array_ref ],
46 [ $hash_ref => $hash_ref ],
47 [ $code_ref => $code_ref ],
50 # Test breaking encapsulation
53 package Test::Leaner::TestIsDeeplyObject;
63 package Test::Leaner::TestIsDeeplyObject2;
73 [ map Test::Leaner::TestIsDeeplyObject->new(
74 a => [ 1, { b => 2, c => undef }, undef, \3 ],
75 c => { d => \(\4), e => [ 5, undef ] },
78 Test::Leaner::TestIsDeeplyObject->new(a => 1),
79 Test::Leaner::TestIsDeeplyObject2->new(a => 1),
84 package Test::Leaner::TestIsDeeplyOverload;
86 use overload 'eq' => sub {
90 $y = $y->{str} if ref $y;
92 ($x, $y) = ($y, $x) if $r;
97 sub new { bless { str => $_[1] }, $_[0] }
100 push @tests, [ map Test::Leaner::TestIsDeeplyOverload->new('foo'), 1 .. 2 ];
103 is_deeply $t->[0], $t->[1];
106 # Test vivification of deleted elements of an array
111 is_deeply \@l, [ 1, undef, 3 ];
113 is_deeply \@l, [ 1 ];