#!./perl
BEGIN {
- chdir 't';
+ chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
{ # undef 3rd arg
local $^W = 1;
local $SIG{__WARN__} = sub { ++$w };
- dbmopen(%truffe, 'pleaseletthisfilenotexist', undef);
+ # 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.*";
}