4 use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
8 use Test::More tests =>6;
11 require( File::Spec->catfile('t', 'common.pl') )
12 or die "Can't load t/common.pl";
15 use constant FILENAME => File::Spec->catfile(TESTDIR, 'testing.txt');
22 my ($src, $dest, $pred) = @_;
23 $zip = Archive::Zip->new();
24 $zip->addTree($src, $dest, $pred);
25 @memberNames = $zip->memberNames();
30 my ($src, $dest, $pred, $lookFor) = @_;
31 makeZip($src, $dest, $pred);
33 ok( (grep { $_ eq $lookFor } @memberNames) == 1 )
34 or print STDERR "Can't find $lookFor in (" . join(",", @memberNames) . ")\n";
37 my ($testFileVolume, $testFileDirs, $testFileName) = File::Spec->splitpath($0);
39 makeZipAndLookFor('.', '', sub { print "file $_\n"; -f && /\.t$/ }, 't/02_main.t' );
40 makeZipAndLookFor('.', 'e/', sub { -f && /\.t$/ }, 'e/t/02_main.t');
41 makeZipAndLookFor('./t', '', sub { -f && /\.t$/ }, '02_main.t' );