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