10 use Archive
::Zip
qw( :ERROR_CODES :CONSTANTS );
14 use Test
::More tests
=>6;
17 require( File
::Spec
->catfile('t', 'common.pl') )
18 or die "Can't load t/common.pl";
21 use constant FILENAME
=> File
::Spec
->catfile(TESTDIR
, 'testing.txt');
28 my ($src, $dest, $pred) = @_;
29 $zip = Archive
::Zip
->new();
30 $zip->addTree($src, $dest, $pred);
31 @memberNames = $zip->memberNames();
36 my ($src, $dest, $pred, $lookFor) = @_;
37 makeZip
($src, $dest, $pred);
39 ok
( (grep { $_ eq $lookFor } @memberNames) == 1 )
40 or print STDERR
"Can't find $lookFor in (" . join(",", @memberNames) . ")\n";
43 my ($testFileVolume, $testFileDirs, $testFileName) = File
::Spec
->splitpath($0);
45 makeZipAndLookFor
('.', '', sub { print "file $_\n"; -f
&& /\.t$/ }, 't/02_main.t' );
46 makeZipAndLookFor
('.', 'e/', sub { -f
&& /\
.t
$/ }, 'e/t
/02_main
.t
');
47 makeZipAndLookFor('./t', '', sub { -f && /\
.t
$/ }, '02_main.t' );