From: rkinyon Date: Wed, 10 May 2006 19:47:57 +0000 (+0000) Subject: r13057@rob-kinyons-powerbook58: rob | 2006-05-10 15:38:57 -0400 X-Git-Tag: 0-99_03~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f213981cc3ee493dafe640a2be653a54590a6d9;p=dbsrgits%2FDBM-Deep.git r13057@rob-kinyons-powerbook58: rob | 2006-05-10 15:38:57 -0400 Checked in another failing test on the delete ->{foo} topic --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index e51b544..ccaac7f 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -437,7 +437,6 @@ sub STORE { my $self = shift->_get_self; my ($key, $value, $orig_key) = @_; - if ( !FileHandle::Fmode::is_W( $self->_fh ) ) { $self->_throw_error( 'Cannot write to a readonly filehandle' ); } diff --git a/t/37_delete_edge_cases.t b/t/37_delete_edge_cases.t new file mode 100644 index 0000000..8a52014 --- /dev/null +++ b/t/37_delete_edge_cases.t @@ -0,0 +1,28 @@ +## +# DBM::Deep Test +## +use strict; +use Test::More tests => 5; +use Test::Deep; +use Clone::Any qw( clone ); +use t::common qw( new_fh ); + +use_ok( 'DBM::Deep' ); + +my ($fh, $filename) = new_fh(); +my $db = DBM::Deep->new( $filename ); + +my $x = { + a => 1, + b => 2, + c => [ 1 .. 3 ], +}; + +my $x_save = clone( $x ); + +$db->{foo} = $x; +ok( tied(%$x), "\$x is tied" ); +delete $db->{foo}; + +ok( !tied(%$x), "\$x is NOT tied" ); +cmp_deeply( $x, $x_save, "When it's deleted, it's untied" );