2 # $Id: /mirror/googlecode/test-more/t/circular_data.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
4 # Test is_deeply and friends with circular data structures [rt.cpan.org 7289]
7 if( $ENV{PERL_CORE} ) {
9 @INC = ('../lib', 'lib');
12 unshift @INC, 't/lib';
17 use Test::More tests => 11;
25 ok( eq_array ($a1, $a2) );
26 ok( eq_set ($a1, $a2) );
28 my $h1 = { 1=>1, 2=>2, 3=>3 };
30 my $h2 = { 1=>1, 2=>2, 3=>3 };
34 ok( eq_hash ($h1, $h2) );
41 ok( eq_array ([$s], [$r]) );
45 # Classic set of circular scalar refs.
63 # Make sure the circular ref checks don't get confused by a reference
64 # which is simply repeating.
69 is_deeply( [$a, $a], [$b, $c] );
70 is_deeply( { foo => $a, bar => $a }, { foo => $b, bar => $c } );
71 is_deeply( [\$a, \$a], [\$b, \$c] );