5 use Test::More tests => 7;
7 use t::common qw( new_fh );
11 my ($fh, $filename) = new_fh();
12 my $db = DBM::Deep->new( $filename );
14 $db->{key1} = "value1";
15 is( $db->{key1}, "value1", "Value set correctly" );
17 # Testing to verify that the close() will occur if open is called on an open DB.
18 #XXX WOW is this hacky ...
19 $db->_get_self->{engine}->open( $db->_get_self );
20 is( $db->{key1}, "value1", "Value still set after re-open" );
23 my $db = DBM::Deep->new( 't' );
24 } qr/^DBM::Deep: Cannot sysopen file 't': /, "Can't open a file we aren't allowed to touch";
27 my $db = DBM::Deep->new( __FILE__ );
28 } qr/^DBM::Deep: Signature not found -- file is not a Deep DB/, "Only DBM::Deep DB files will be opened";
31 my $db = DBM::Deep->new(
35 $db->_get_self->{engine}->close_fh( $db->_get_self );
40 my $db = DBM::Deep->new(
45 $db->_get_self->{engine}->close_fh( $db->_get_self );