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($filename))[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($filename))[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($filename))[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" );
82 skip "Largefile support is not compiled into $^X", 3
85 my ($fh, $filename) = new_fh();
87 my $db = DBM::Deep->new(
93 $db->{key1} = "value1";
94 $db->{key2} = "value2";
95 $large = (stat($filename))[7];
98 # This tests the header to verify that the pack_size is really there
100 my $db = DBM::Deep->new(
104 is( $db->{key1}, 'value1', 'Can read key1' );
105 is( $db->{key2}, 'value2', 'Can read key2' );
107 cmp_ok( $medium, '<', $large, "medium is smaller than large" );
111 # skip "Largefile support is compiled into $^X", 3
114 # my ($fh, $filename) = new_fh();
116 # my $db = DBM::Deep->new(
119 # pack_size => 'large',