5 use Test::More tests => 13;
10 my $db = DBM::Deep->new( "t/test.db" );
15 $db->{key1} = "value1";
16 $db->{key2} = "value2";
19 # Insert circular reference
24 # Make sure keys exist in both places
26 is( $db->{key1}, 'value1', "The value is there directly" );
27 is( $db->{circle}{key1}, 'value1', "The value is there in one loop of the circle" );
28 is( $db->{circle}{circle}{key1}, 'value1', "The value is there in two loops of the circle" );
29 is( $db->{circle}{circle}{circle}{key1}, 'value1', "The value is there in three loops of the circle" );
32 # Make sure changes are reflected in both places
34 $db->{key1} = "another value";
36 is( $db->{key1}, 'another value', "The value is there directly" );
37 is( $db->{circle}{key1}, 'another value', "The value is there in one loop of the circle" );
38 is( $db->{circle}{circle}{key1}, 'another value', "The value is there in two loops of the circle" );
39 is( $db->{circle}{circle}{circle}{key1}, 'another value', "The value is there in three loops of the circle" );
41 $db->{circle}{circle}{circle}{circle}{key1} = "circles";
43 is( $db->{key1}, 'circles', "The value is there directly" );
44 is( $db->{circle}{key1}, 'circles', "The value is there in one loop of the circle" );
45 is( $db->{circle}{circle}{key1}, 'circles', "The value is there in two loops of the circle" );
46 is( $db->{circle}{circle}{circle}{key1}, 'circles', "The value is there in three loops of the circle" );