2 use warnings FATAL => 'all';
6 use t::common qw( new_fh );
10 my ($default, $small, $medium, $large);
13 my ($fh, $filename) = new_fh();
14 my $db = DBM::Deep->new(
18 $db->{key1} = "value1";
19 $db->{key2} = "value2";
20 $default = (stat($filename))[7];
24 my ($fh, $filename) = new_fh();
26 my $db = DBM::Deep->new(
29 pack_size => 'medium',
32 $db->{key1} = "value1";
33 $db->{key2} = "value2";
34 $medium = (stat($filename))[7];
37 # This tests the header to verify that the pack_size is really there
39 my $db = DBM::Deep->new(
43 is( $db->{key1}, 'value1', 'Can read key1' );
44 is( $db->{key2}, 'value2', 'Can read key2' );
47 cmp_ok( $medium, '==', $default, "The default is medium" );
51 my ($fh, $filename) = new_fh();
53 my $db = DBM::Deep->new(
59 $db->{key1} = "value1";
60 $db->{key2} = "value2";
61 $small = (stat($filename))[7];
64 # This tests the header to verify that the pack_size is really there
66 my $db = DBM::Deep->new(
70 is( $db->{key1}, 'value1', 'Can read key1' );
71 is( $db->{key2}, 'value2', 'Can read key2' );
74 cmp_ok( $medium, '>', $small, "medium is greater than small" );
81 skip "Largefile support is not compiled into $^X", 3
84 my ($fh, $filename) = new_fh();
86 my $db = DBM::Deep->new(
92 $db->{key1} = "value1";
93 $db->{key2} = "value2";
94 $large = (stat($filename))[7];
97 # This tests the header to verify that the pack_size is really there
99 my $db = DBM::Deep->new(
103 is( $db->{key1}, 'value1', 'Can read key1' );
104 is( $db->{key2}, 'value2', 'Can read key2' );
106 cmp_ok( $medium, '<', $large, "medium is smaller than large" );
110 # skip "Largefile support is compiled into $^X", 3
113 # my ($fh, $filename) = new_fh();
115 # my $db = DBM::Deep->new(
118 # pack_size => 'large',