5 use Test::More tests => 5;
7 use t::common qw( new_fh );
11 diag "This test can take up to a minute to run. Please be patient.";
13 my ($fh, $filename) = new_fh();
14 my $db = DBM::Deep->new(
16 type => DBM::Deep->TYPE_HASH,
24 for ( 0 .. $max_keys ) {
25 $db->put( "hello $_" => "there " . $_ * 2 );
29 for ( 0 .. $max_keys ) {
31 unless ( $db->get( "hello $_" ) eq "there " . $_ * 2 ) {
35 is( $count, $max_keys, "We read $count keys" );
37 my @keys = sort keys %$db;
38 cmp_ok( scalar(@keys), '==', $max_keys + 1, "Number of keys is correct" );
39 my @control = sort map { "hello $_" } 0 .. $max_keys;
40 cmp_deeply( \@keys, \@control, "Correct keys are there" );
43 cmp_ok( scalar(keys %$db), '==', 0, "Number of keys after clear() is correct" );