5 use Test::More tests => 15;
7 use t::common qw( new_fh );
11 my ($fh, $filename) = new_fh();
12 my $db = DBM::Deep->new(
19 my $db2 = DBM::Deep->new(
27 $db->{bar} = $db->{foo};
29 is( $db->{foo}, 5, "Foo is still 5" );
30 is( $db->{bar}, 5, "Bar is now 5" );
34 is( $db->{foo}, 6, "Foo is now 6" );
35 is( $db->{bar}, 5, "Bar is still 5" );
37 $db->{foo} = [ 1 .. 3 ];
38 $db->{bar} = $db->{foo};
40 is( $db->{foo}[1], 2, "Foo[1] is still 2" );
41 is( $db->{bar}[1], 2, "Bar[1] is now 2" );
45 is( $db->{foo}[3], 42, "Foo[3] is now 42" );
46 is( $db->{bar}[3], 42, "Bar[3] is also 42" );
49 is( $db->{bar}[3], 42, "After delete Foo, Bar[3] is still 42" );
51 $db->{foo} = $db->{bar};
57 is( $db2->{bar}, undef, "It's deleted in the transaction" );
58 is( $db->{bar}[3], 42, "... but not in the main" );
62 # Why hasn't this failed!? Is it because stuff isn't getting deleted as expected?
63 # I need a test that walks the sectors
64 is( $db->{bar}[3], 42, "After delete Foo, Bar[3] is still 42" );
65 is( $db2->{bar}[3], 42, "After delete Foo, Bar[3] is still 42" );
69 is( $db->{bar}[3], 42, "After delete Foo, Bar[3] is still 42" );
82 ok( !exists $db->{bar}, "After commit, bar is gone" );