Commit | Line | Data |
---|---|---|
ffed8b01 | 1 | ## |
2 | # DBM::Deep Test | |
3 | ## | |
4 | use strict; | |
a8d2331c | 5 | use Test::More tests => 4; |
fde3db1a | 6 | |
7 | use t::common qw( new_fh ); | |
ffed8b01 | 8 | |
967b9c88 | 9 | diag "Testing DBM::Deep against Perl $] located at $^X"; |
10 | ||
ffed8b01 | 11 | use_ok( 'DBM::Deep' ); |
12 | ||
13 | ## | |
14 | # basic file open | |
15 | ## | |
fde3db1a | 16 | my ($fh, $filename) = new_fh(); |
58910373 | 17 | my $db = eval { |
18 | local $SIG{__DIE__}; | |
19 | DBM::Deep->new( $filename ); | |
20 | }; | |
95967a5e | 21 | if ( $@ ) { |
22 | diag "ERROR: $@"; | |
2120a181 | 23 | Test::More->builder->BAIL_OUT( "Opening a new file fails." ); |
ffed8b01 | 24 | } |
25 | ||
26 | isa_ok( $db, 'DBM::Deep' ); | |
27 | ok(1, "We can successfully open a file!" ); | |
695c88b1 | 28 | |
29 | $db->{foo} = 'bar'; | |
a8d2331c | 30 | is( $db->{foo}, 'bar' ); |