Further changes
[dbsrgits/DBM-Deep.git] / t / 23_misc.t
index e393853..9e6944b 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use Test::More;
 use Test::Exception;
 
-plan tests => 5;
+plan tests => 7;
 
 use_ok( 'DBM::Deep' );
 
@@ -25,8 +25,27 @@ is( $db->{key1}, "value1", "Value still set after re-open" );
 
 throws_ok {
     my $db = DBM::Deep->new( 't' );
-} qr/^DBM::Deep: Cannot open file: t: /, "Can't open a file we aren't allowed to touch";
+} qr/^DBM::Deep: Cannot sysopen file: t: /, "Can't open a file we aren't allowed to touch";
 
 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";
+
+{
+    my $db = DBM::Deep->new(
+        file => 't/test.db',
+        locking => 1,
+    );
+    $db->_close;
+    ok( !$db->lock );
+}
+
+{
+    my $db = DBM::Deep->new(
+        file => 't/test.db',
+        locking => 1,
+    );
+    $db->lock;
+    $db->_close;
+    ok( !$db->unlock );
+}