Converted all relevant tests to use new_dbm instead of new_fh and all tests (except...
[dbsrgits/DBM-Deep.git] / t / 97_dump_file.t
1 use strict;
2 use warnings FATAL => 'all';
3
4 use Test::More;
5 use Test::Deep;
6 use t::common qw( new_fh );
7
8 use_ok( 'DBM::Deep' );
9
10 my ($fh, $filename) = new_fh();
11 my $db = DBM::Deep->new( $filename );
12
13 is( $db->_dump_file, <<"__END_DUMP__", "Dump of initial file correct" );
14 NumTxns: 1
15 Chains(B):
16 Chains(D):
17 Chains(I):
18 00000030: H  0064 REF: 1
19 __END_DUMP__
20
21 $db->{foo} = 'bar';
22
23 is( $db->_dump_file, <<"__END_DUMP__", "Dump of file after single assignment" );
24 NumTxns: 1
25 Chains(B):
26 Chains(D):
27 Chains(I):
28 00000030: H  0064 REF: 1
29 00000094: D  0064 bar
30 00000158: B  0387
31     00000545 00000094
32 00000545: D  0064 foo
33 __END_DUMP__
34
35 done_testing;