r11693@rob-kinyons-powerbook58: rob | 2006-04-30 22:15:38 -0400
[dbsrgits/DBM-Deep.git] / t / 07_locking.t
index 58ea83f..09e3c8d 100644 (file)
@@ -2,21 +2,16 @@
 # DBM::Deep Test
 ##
 use strict;
-use Test::More tests => 3;
+use Test::More tests => 4;
+use t::common qw( new_fh );
 
 use_ok( 'DBM::Deep' );
 
-##
-# basic file open
-##
-unlink "t/test.db";
+my ($fh, $filename) = new_fh();
 my $db = DBM::Deep->new(
-       file => "t/test.db",
-       locking => 1
+       file => $filename,
+       locking => 1,
 );
-if ($db->error()) {
-       die "ERROR: " . $db->error();
-}
 
 ##
 # basic put/get
@@ -24,6 +19,9 @@ if ($db->error()) {
 $db->{key1} = "value1";
 is( $db->{key1}, "value1", "key1 is set" );
 
+$db->{key2} = [ 1 .. 3 ];
+is( $db->{key2}[1], 2 );
+
 ##
 # explicit lock
 ##