Test::More 0.88 is required for done_testing
[dbsrgits/DBM-Deep.git] / t / 28_index_sector.t
CommitLineData
2120a181 1use strict;
2use Test::More tests => 40;
3use Test::Deep;
4use t::common qw( new_fh );
5
6use_ok( 'DBM::Deep' );
7
8my ($fh, $filename) = new_fh();
9my $db = DBM::Deep->new(
10 file => $filename,
11 locking => 1,
12 autoflush => 1,
13);
14
15for ( 1 .. 17 ) {
16 $db->{ $_ } = $_;
17 is( $db->{$_}, $_, "Addition of $_ is still $_" );
18}
19
20for ( 1 .. 17 ) {
21 is( $db->{$_}, $_, "Verification of $_ is still $_" );
22}
23
24my @keys = keys %$db;
25cmp_ok( scalar(@keys), '==', 17, "Right number of keys returned" );
26
27ok( !exists $db->{does_not_exist}, "EXISTS works on large hashes for non-existent keys" );
28is( $db->{does_not_exist}, undef, "autovivification works on large hashes" );
29ok( exists $db->{does_not_exist}, "EXISTS works on large hashes for newly-existent keys" );
30cmp_ok( scalar(keys %$db), '==', 18, "Number of keys after autovivify is correct" );
31