2 use warnings FATAL => 'all';
6 plan skip_all => "You must set \$ENV{LONG_TESTS} to run the long tests"
7 unless $ENV{LONG_TESTS};
9 use t::common qw( new_dbm );
11 use_ok( 'DBM::Deep' );
13 diag "This test can take up to several minutes to run. Please be patient.";
15 my $dbm_factory = new_dbm( type => DBM::Deep->TYPE_ARRAY );
16 while ( my $dbm_maker = $dbm_factory->() ) {
17 my $db = $dbm_maker->();
24 for ( 0 .. $max_keys ) {
25 $db->put( $_ => $_ * 2 );
29 for ( 0 .. $max_keys ) {
31 unless ( $db->get( $_ ) == $_ * 2 ) {
35 is( $count, $max_keys, "We read $count keys" );
37 cmp_ok( scalar(@$db), '==', $max_keys + 1, "Number of elements is correct" );
39 cmp_ok( scalar(@$db), '==', 0, "Number of elements after clear() is correct" );