5 use Test::More tests => 5;
10 my $db = DBM::Deep->new(
15 die "ERROR: " . $db->error();
19 # create some unused space
21 $db->{key1} = "value1";
22 $db->{key2} = "value2";
26 $db->{a}{c} = 'value2';
28 my $b = $db->{a}->{b};
46 # take byte count readings before, and after optimize
48 my $before = (stat($db->fh()))[7];
49 my $result = $db->optimize();
50 my $after = (stat($db->fh()))[7];
53 die "ERROR: " . $db->error();
57 ok( $after < $before ); # make sure file shrunk
59 is( $db->{key1}, 'value1', "key1's value is still there after optimize" );
60 is( $db->{a}{c}, 'value2', "key2's value is still there after optimize" );