##
my $self = shift->_get_self;
my ($key, $value) = @_;
- warn "STORE($self, $key, @{[defined$value?$value:'undef']})\n" if DEBUG;
+ warn "STORE($self, '$key', '@{[defined$value?$value:'undef']}')\n" if DEBUG;
unless ( $self->_engine->storage->is_writable ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
$value = $self->_engine->storage->{filter_store_value}->( $value );
}
- $self->_engine->write_value( $self, $key, $value);
+ my $x = $self->_engine->write_value( $self, $key, $value);
$self->unlock;
##
my $self = shift->_get_self;
my ($key) = @_;
- warn "FETCH($self,$key)\n" if DEBUG;
+ warn "FETCH($self, '$key')\n" if DEBUG;
$self->lock_shared;
##
my $self = shift->_get_self;
my ($key) = @_;
- warn "DELETE($self,$key)\n" if DEBUG;
+ warn "DELETE($self, '$key')\n" if DEBUG;
unless ( $self->_engine->storage->is_writable ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
##
my $self = shift->_get_self;
my ($key) = @_;
- warn "EXISTS($self,$key)\n" if DEBUG;
+ warn "EXISTS($self, '$key')\n" if DEBUG;
$self->lock_shared;
my $self = shift;
my ($args) = @_;
- # XXX What should happen if this fails?
+ # This can return nothing if we are deleting an entry in a hashref that was
+ # auto-vivified as part of the delete process. For example:
+ # my $x = {};
+ # delete $x->{foo}{bar};
my $blist = $self->get_bucket_list({
key_md5 => $args->{key_md5},
- }) or DBM::Deep->_throw_error( "How did delete_key fail (no blist)?!" );
+ }) or return;
# Save the location so that we can free the data
my $location = $blist->get_data_location_for({
+use 5.006_000;
use strict;
+use warnings FATAL => 'all';
+
use Test::More;
use t::common qw( new_fh );
my $max = 10;
-plan skip_all => "Need to work on this one later.";
-
plan tests => $max + 1;
use_ok( 'DBM::Deep' );
my ($fh, $filename) = new_fh();
my $db = DBM::Deep->new( file => $filename, fh => $fh, );
-my $x = 0;
-while( $x < $max ) {
+my $x = 1;
+while( $x <= $max ) {
eval {
delete $db->{borked}{test};
$db->{borked}{test} = 1;
};
- ok(!$@, 'No eval failures');
+ ok(!$@, "No eval failure after ${x}th iteration");
$x++;
}