Commit | Line | Data |
ffed8b01 |
1 | ## |
2 | # DBM::Deep Test |
3 | ## |
4 | use strict; |
5 | use Test::More tests => 2; |
6 | |
7 | use_ok( 'DBM::Deep' ); |
8 | |
9 | unlink "t/test.db"; |
10 | my $db = DBM::Deep->new( |
11 | file => "t/test.db", |
12 | autoflush => 1 |
13 | ); |
14 | if ($db->error()) { |
15 | die "ERROR: " . $db->error(); |
16 | } |
17 | $db->{key1} = "value1"; |
18 | $db->{key2} = "value2"; |
19 | my $before = (stat($db->fh()))[7]; |
20 | undef $db; |
21 | |
22 | ## |
23 | # set pack to 2-byte (16-bit) words |
24 | ## |
25 | DBM::Deep::set_pack(2, 'S'); |
26 | |
27 | unlink "t/test.db"; |
28 | $db = DBM::Deep->new( |
29 | file => "t/test.db", |
30 | autoflush => 1 |
31 | ); |
32 | if ($db->error()) { |
33 | die "ERROR: " . $db->error(); |
34 | } |
35 | $db->{key1} = "value1"; |
36 | $db->{key2} = "value2"; |
37 | my $after = (stat($db->fh()))[7]; |
38 | undef $db; |
39 | |
40 | ok( $after < $before ); |