Moved _create_tag, _load_tag, and _index_lookup into the engine
[dbsrgits/DBM-Deep.git] / t / 13_setpack.t
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 $db->{key1} = "value1";
15 $db->{key2} = "value2";
16 my $before = (stat($db->_fh()))[7];
17 undef $db;
18
19 ##
20 # set pack to 2-byte (16-bit) words
21 ##
22 DBM::Deep::set_pack(2, 'S');
23
24 unlink "t/test.db";
25 $db = DBM::Deep->new(
26         file => "t/test.db",
27         autoflush => 1
28 );
29 $db->{key1} = "value1";
30 $db->{key2} = "value2";
31 my $after = (stat($db->_fh()))[7];
32 undef $db;
33
34 ok( $after < $before );