3 # Test is_deeply and friends with circular data structures [rt.cpan.org 7289]
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib';
16 use Test::More tests => 11;
24 ok( eq_array ($a1, $a2) );
25 ok( eq_set ($a1, $a2) );
27 my $h1 = { 1=>1, 2=>2, 3=>3 };
29 my $h2 = { 1=>1, 2=>2, 3=>3 };
33 ok( eq_hash ($h1, $h2) );
40 ok( eq_array ([$s], [$r]) );
44 # Classic set of circular scalar refs.
62 # Make sure the circular ref checks don't get confused by a reference
63 # which is simply repeating.
68 is_deeply( [$a, $a], [$b, $c] );
69 is_deeply( { foo => $a, bar => $a }, { foo => $b, bar => $c } );
70 is_deeply( [\$a, \$a], [\$b, \$c] );