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