6 use Test::More tests => 10;
7 use t::common qw( new_fh );
11 my ($default, $small, $medium, $large);
14 my ($fh, $filename) = new_fh();
15 my $db = DBM::Deep->new(
19 $db->{key1} = "value1";
20 $db->{key2} = "value2";
21 $default = (stat($db->_fh()))[7];
25 my ($fh, $filename) = new_fh();
27 my $db = DBM::Deep->new(
30 pack_size => 'medium',
33 $db->{key1} = "value1";
34 $db->{key2} = "value2";
35 $medium = (stat($db->_fh()))[7];
38 # This tests the header to verify that the pack_size is really there
40 my $db = DBM::Deep->new(
44 is( $db->{key1}, 'value1', 'Can read key1' );
45 is( $db->{key2}, 'value2', 'Can read key2' );
48 cmp_ok( $medium, '==', $default, "The default is medium" );
52 my ($fh, $filename) = new_fh();
54 my $db = DBM::Deep->new(
60 $db->{key1} = "value1";
61 $db->{key2} = "value2";
62 $small = (stat($db->_fh()))[7];
65 # This tests the header to verify that the pack_size is really there
67 my $db = DBM::Deep->new(
71 is( $db->{key1}, 'value1', 'Can read key1' );
72 is( $db->{key2}, 'value2', 'Can read key2' );
75 cmp_ok( $medium, '>', $small, "medium is greater than small" );
79 skip "Largefile support is not compiled into $^X", 3
80 if 1; #unless $Config{ uselargefile };
82 my ($fh, $filename) = new_fh();
84 my $db = DBM::Deep->new(
90 $db->{key1} = "value1";
91 $db->{key2} = "value2";
92 $large = (stat($db->_fh()))[7];
95 # This tests the header to verify that the pack_size is really there
97 my $db = DBM::Deep->new(
101 is( $db->{key1}, 'value1', 'Can read key1' );
102 is( $db->{key2}, 'value2', 'Can read key2' );
104 cmp_ok( $medium, '<', $large, "medium is smaller than large" );