From: sprout Date: Sun, 24 Jan 2010 19:06:31 +0000 (-0800) Subject: Fix for [RT #32462]: avoid leading temp files around X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=345e7fd079ea47414f8d2601e47689a0dbd16c97;p=dbsrgits%2FDBM-Deep.git Fix for [RT #32462]: avoid leading temp files around --- diff --git a/t/27_filehandle.t b/t/27_filehandle.t index 846d3bb..be5f58c 100644 --- a/t/27_filehandle.t +++ b/t/27_filehandle.t @@ -61,6 +61,14 @@ my $db = DBM::Deep->new({ }); is($db->{x}, 'b', "and get at stuff in the database"); __END_FH__ + + # The exec below prevents END blocks from doing this. + (my $esc_dir = $t::common::dir) =~ s/(.)/sprintf "\\x{%x}", ord $1/egg; + print $fh <<__END_FH_AGAIN__; +use File::Path 'rmtree'; +rmtree "$esc_dir"; +__END_FH_AGAIN__ + print $fh "__DATA__\n"; close $fh; diff --git a/t/common.pm b/t/common.pm index 97cd1c9..135ed66 100644 --- a/t/common.pm +++ b/t/common.pm @@ -18,7 +18,7 @@ use File::Temp qw( tempfile tempdir ); use Fcntl qw( :flock ); my $parent = $ENV{WORK_DIR} || File::Spec->tmpdir; -my $dir = tempdir( CLEANUP => 1, DIR => $parent ); +our $dir = tempdir( CLEANUP => 1, DIR => $parent ); #my $dir = tempdir( DIR => '.' ); sub new_fh {