#!./perl
BEGIN {
- chdir 't';
+ chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
skip_all("No dbm functions") if $@;
}
-plan tests => 4;
+plan tests => 5;
# This is [20020104.007] "coredump on dbmclose"
fresh_perl_like('delete $::{"AnyDBM_File::"}; ' . $prog,
qr/No dbm on this machine/, {},
'implicit require and no stash fails');
+
+{ # undef 3rd arg
+ local $^W = 1;
+ local $SIG{__WARN__} = sub { ++$w };
+ # Files may get created as a side effect of dbmopen, so ensure cleanup.
+ my $leaf = 'pleaseletthisfilenotexist';
+ dbmopen(%truffe, $leaf, undef);
+ is $w, 1, '1 warning from dbmopen with undef third arg';
+ unlink $leaf
+ if -e $leaf;
+ 1 while unlink glob "$leaf.*";
+}