Added unflocks to all tests so that the tests run on OSX
[dbsrgits/DBM-Deep.git] / t / 01_basic.t
1 ##
2 # DBM::Deep Test
3 ##
4 use strict;
5 use Test::More tests => 3;
6 use File::Temp qw( tempfile tempdir );
7 use Fcntl qw( :flock );
8
9 diag "Testing DBM::Deep against Perl $] located at $^X";
10
11 use_ok( 'DBM::Deep' );
12
13 ##
14 # basic file open
15 ##
16 my $dir = tempdir( CLEANUP => 1 );
17 my ($fh, $filename) = tempfile( 'tmpXXXX', DIR => $dir );
18 flock $fh, LOCK_UN;
19 my $db = eval {
20     local $SIG{__DIE__};
21     DBM::Deep->new( $filename );
22 };
23 if ( $@ ) {
24         diag "ERROR: $@";
25     Test::More->builder->BAIL_OUT( "Opening a new file fails" );
26 }
27
28 isa_ok( $db, 'DBM::Deep' );
29 ok(1, "We can successfully open a file!" );