---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
- blib/lib/DBM/Deep.pm 87.7 81.0 81.0 93.9 89.5 4.2 87.2
- blib/lib/DBM/Deep/Array.pm 95.9 88.3 100.0 96.4 100.0 4.9 94.5
- blib/lib/DBM/Deep/Engine.pm 94.3 83.9 78.0 94.6 0.0 60.0 87.9
- blib/lib/DBM/Deep/File.pm 88.5 76.2 45.5 93.8 0.0 28.9 78.8
- blib/lib/DBM/Deep/Hash.pm 98.5 83.3 100.0 100.0 100.0 2.1 96.3
- Total 93.0 83.4 77.5 95.0 31.6 100.0 88.3
+ blib/lib/DBM/Deep.pm 88.1 81.0 81.0 97.9 89.5 4.7 87.9
+ blib/lib/DBM/Deep/Array.pm 99.5 90.0 100.0 100.0 100.0 5.8 97.6
+ blib/lib/DBM/Deep/Engine.pm 95.6 84.6 78.0 99.1 0.0 58.8 89.3
+ blib/lib/DBM/Deep/File.pm 92.6 80.0 45.5 100.0 0.0 28.8 82.6
+ blib/lib/DBM/Deep/Hash.pm 98.5 83.3 100.0 100.0 100.0 2.0 96.3
+ Total 94.7 84.4 77.5 99.1 32.1 100.0 89.9
---------------------------- ------ ------ ------ ------ ------ ------ ------
=head1 MORE INFORMATION
$self->_init;
return $self;
}
-sub _init {}
-sub clone { die "Must be implemented in the child class" }
+#sub _init {}
+#sub clone { die "Must be implemented in the child class" }
sub engine { $_[0]{engine} }
sub offset { $_[0]{offset} }
my $e = $self->engine;
for my $i ( 0 .. $e->hash_chars - 1 ) {
- my $l = $self->location_for( $i ) or next;
+ my $l = $self->get_entry( $i ) or next;
$e->_load_sector( $l )->free;
}
type => DBM::Deep->TYPE_HASH,
);
+$db->{foo} = {};
+my $foo = $db->{foo};
+
##
# put/get many keys
##
my $max_keys = 4000;
for ( 0 .. $max_keys ) {
- $db->put( "hello $_" => "there " . $_ * 2 );
+ $foo->put( "hello $_" => "there " . $_ * 2 );
}
my $count = -1;
for ( 0 .. $max_keys ) {
$count = $_;
- unless ( $db->get( "hello $_" ) eq "there " . $_ * 2 ) {
+ unless ( $foo->get( "hello $_" ) eq "there " . $_ * 2 ) {
last;
};
}
is( $count, $max_keys, "We read $count keys" );
-#SKIP: {
-#skip "Keys aren't ready yet", 3;
-my @keys = sort keys %$db;
+my @keys = sort keys %$foo;
cmp_ok( scalar(@keys), '==', $max_keys + 1, "Number of keys is correct" );
my @control = sort map { "hello $_" } 0 .. $max_keys;
cmp_deeply( \@keys, \@control, "Correct keys are there" );
$db->clear;
cmp_ok( scalar(keys %$db), '==', 0, "Number of keys after clear() is correct" );
-#}