Converted all relevant tests to use new_dbm instead of new_fh and all tests (except...
[dbsrgits/DBM-Deep.git] / t / 01_basic.t
CommitLineData
ffed8b01 1use strict;
0e3e3555 2use warnings FATAL => 'all';
3
4use Test::More;
fde3db1a 5
6use t::common qw( new_fh );
ffed8b01 7
967b9c88 8diag "Testing DBM::Deep against Perl $] located at $^X";
9
ffed8b01 10use_ok( 'DBM::Deep' );
11
12##
13# basic file open
14##
fde3db1a 15my ($fh, $filename) = new_fh();
58910373 16my $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
24isa_ok( $db, 'DBM::Deep' );
25ok(1, "We can successfully open a file!" );
695c88b1 26
27$db->{foo} = 'bar';
0e3e3555 28is( $db->{foo}, 'bar', 'We can write and read.' );
29
30done_testing;