1
# Test Archive::Zip::Tree module
3
# Before `make install' is performed this script should be runnable with
4
# `make test'. After `make install' it should work as `perl t/testTree.t'
5
# vim: ts=4 sw=4 ft=perl
11
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
20
my ($src, $dest, $pred) = @_;
21
$zip = Archive::Zip->new();
22
$zip->addTree($src, $dest, $pred);
23
@memberNames = $zip->memberNames();
28
my ($src, $dest, $pred, $lookFor) = @_;
29
makeZip($src, $dest, $pred);
31
ok( (grep { $_ eq $lookFor } @memberNames) == 1 )
32
or print STDERR "Can't find $lookFor in (" . join(",", @memberNames) . ")\n";
35
BEGIN { plan tests => 6, todo => [] }
37
BEGIN { require 't/common.pl' }
39
use constant FILENAME => File::Spec->catfile(TESTDIR, 'testing.txt');
41
my ($testFileVolume, $testFileDirs, $testFileName) = File::Spec->splitpath($0);
43
makeZipAndLookFor('.', '', sub { print "file $_\n"; -f && /\.t$/ }, 't/test.t' );
44
makeZipAndLookFor('.', 'e/', sub { -f && /\.t$/ }, 'e/t/test.t');
45
makeZipAndLookFor('./t', '', sub { -f && /\.t$/ }, 'test.t' );