From: rkinyon Date: Fri, 17 Feb 2006 01:45:26 +0000 (+0000) Subject: Added a few more edge case tests re: when the fh is open and what functions are expecting X-Git-Tag: 0-97~59 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ebbe409358f168ae4fb913232f5c9b76e378d276;p=dbsrgits%2FDBM-Deep.git Added a few more edge case tests re: when the fh is open and what functions are expecting --- diff --git a/t/23_misc.t b/t/23_misc.t index e393853..e206ff3 100644 --- a/t/23_misc.t +++ b/t/23_misc.t @@ -5,7 +5,7 @@ use strict; use Test::More; use Test::Exception; -plan tests => 5; +plan tests => 7; use_ok( 'DBM::Deep' ); @@ -30,3 +30,24 @@ throws_ok { throws_ok { my $db = DBM::Deep->new( __FILE__ ); } qr/^DBM::Deep: Signature not found -- file is not a Deep DB/, "Only DBM::Deep DB files will be opened"; + +TODO: { + todo_skip "lock() doesn't check to see if the file is open", 1; + my $db = DBM::Deep->new( + file => 't/test.db', + locking => 1, + ); + $db->_close; + ok( !$db->lock ); +} + +TODO: { + todo_skip "unlock() doesn't check to see if the file is open", 1; + my $db = DBM::Deep->new( + file => 't/test.db', + locking => 1, + ); + $db->lock; + $db->_close; + ok( !$db->unlock ); +}