5 use Test::More tests => 5;
7 use t::common qw( new_fh );
11 my ($fh, $filename) = new_fh();
12 my $db = DBM::Deep->new(
14 type => DBM::Deep->TYPE_HASH,
22 for ( 0 .. $max_keys ) {
23 $db->put( "hello $_" => "there " . $_ * 2 );
27 for ( 0 .. $max_keys ) {
29 unless ( $db->get( "hello $_" ) eq "there " . $_ * 2 ) {
33 is( $count, $max_keys, "We read $count keys" );
35 my @keys = sort keys %$db;
36 cmp_ok( scalar(@keys), '==', $max_keys + 1, "Number of keys is correct" );
37 my @control = sort map { "hello $_" } 0 .. $max_keys;
38 cmp_deeply( \@keys, \@control, "Correct keys are there" );
41 cmp_ok( scalar(keys %$db), '==', 0, "Number of keys after clear() is correct" );