From: Steve Hay Date: Thu, 29 Aug 2013 12:55:32 +0000 (+0100) Subject: Stop t/op/coreamp.t leaving temporary files behind X-Git-Tag: upstream/5.20.0~2090 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7f2696daa830564250fcf2f421bb58e97f14d0d;p=platform%2Fupstream%2Fperl.git Stop t/op/coreamp.t leaving temporary files behind test.pl will delete any file made by tempfile(), but it won't delete the *.dir and *.pag files made by dbmopen. Hopefully this is the right way to delete them, cribbed from lib/AnyDBM_File.t. --- diff --git a/t/op/coreamp.t b/t/op/coreamp.t index fe7c741..759654a 100644 --- a/t/op/coreamp.t +++ b/t/op/coreamp.t @@ -422,6 +422,15 @@ test_proto 'dbmopen'; $db{1} = 2; $db{3} = 4; &mydbmclose(\%db); is scalar keys %db, 0, '&dbmopen and &dbmclose'; + my $Dfile = "$filename.pag"; + if (! -e $Dfile) { + ($Dfile) = <$filename*>; + } + if ($^O eq 'VMS') { + unlink "$filename.sdbm_dir", $Dfile; + } else { + unlink "$filename.dir", $Dfile; + } } test_proto 'die';