Refactored to _descend to fix the recursion bug
[dbsrgits/DBM-Deep.git] / t / 01_basic.t
1 use strict;
2 use warnings FATAL => 'all';
3
4 use Test::More;
5
6 use t::common qw( new_fh );
7
8 diag "Testing DBM::Deep against Perl $] located at $^X";
9
10 use_ok( 'DBM::Deep' );
11
12 ##
13 # basic file open
14 ##
15 my ($fh, $filename) = new_fh();
16 my $db = eval {
17     local $SIG{__DIE__};
18     DBM::Deep->new( $filename );
19 }; if ( $@ ) {
20         diag "ERROR: $@";
21     Test::More->builder->BAIL_OUT( "Opening a new file fails." );
22 }
23
24 isa_ok( $db, 'DBM::Deep' );
25 ok(1, "We can successfully open a file!" );
26
27 $db->{foo} = 'bar';
28 is( $db->{foo}, 'bar', 'We can write and read.' );
29
30 done_testing;