1use warnings; 2use strict; 3use File::Temp qw(tempfile); 4use Cwd; 5 6use Test::More tests => 4; 7BEGIN { use_ok('Archive::Tar::Wrapper') } 8 9my $cwd = getcwd(); 10my $evaled = eval { 11 my $arch = Archive::Tar::Wrapper->new(); 12 my ( undef, $filename ) = tempfile( UNLINK => 1 ); 13 unlink $filename; # OPEN => 0 gave a stupid warning 14 # attempt to generate error from tar by not adding any files 15 $arch->write( $filename, 9 ); 16 1; 17}; 18is $@, '', 'no error'; 19is $evaled, 1, 'survived eval'; 20is getcwd(), $cwd, 'still in original directory'; 21