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