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