2 use warnings FATAL => 'all';
6 use t::common qw( new_dbm );
10 my $dbm_factory = new_dbm(
14 while ( my $dbm_maker = $dbm_factory->() ) {
15 my $db = $dbm_maker->();
18 skip "This engine doesn't support singletons", 8
19 unless $db->supports( 'singletons' );
22 $db->{foo} = { a => 'b' };
26 is( $x, $y, "The references are the same" );
29 is( $x, undef, "After deleting the DB location, external references are also undef (\$x)" );
30 is( $y, undef, "After deleting the DB location, external references are also undef (\$y)" );
31 is( eval { $x + 0 }, undef, "DBM::Deep::Null can be added to." );
32 is( eval { $y + 0 }, undef, "DBM::Deep::Null can be added to." );
33 is( $db->{foo}, undef, "The {foo} location is also undef." );
35 # These shenanigans work to get another hashref
36 # into the same data location as $db->{foo} was.
42 is( $x, undef, "After re-assigning to {foo}, external references to old values are still undef (\$x)" );
43 is( $y, undef, "After re-assigning to {foo}, external references to old values are still undef (\$y)" );
48 skip "What do we do with external references and txns?", 2;
50 my $dbm_factory = new_dbm(
55 while ( my $dbm_maker = $dbm_factory->() ) {
56 my $db = $dbm_maker->();
58 $db->{foo} = { a => 'b' };
63 $db->{foo} = { c => 'd' };
66 # XXX What should happen here with $x and $y?