# RUN TESTS
run_test(
- [\&test_creation_normal],
+ [\&test_creation_normal, 'normal'],
+ [\&test_creation_normal, 'nested'],
[\&test_creation_incremental, '-g'],
[\&test_creation_incremental, 'tarmode inc'],
[\&test_creation_reset, '-a'],
}
sub test_creation_normal {
+ my ($mode) = @_;
- say "TEST: creation -- normal files (no attributes)";
+ say "TEST: creation -- normal files $mode (no attributes)";
+ my $prefix = ($mode =~ /nest/) ? "/foo/bar/bar/" : '';
my @files;
my $n = 5;
for(1..$n) {
- my $f = File->new_remote("file-$_");
+ my $f = File->new_remote($prefix."file-$_");
$f->set_attr();
push @files, $f;
}
return check_tar($TAR, \@files);
}
-
sub test_creation_incremental {
my ($mode) = @_;
return undef if !$s->{remote};
if($s->{dir}) {
- $main::DIR.'/'.$s->{dir}.'/'.$s->{name};
+ $main::DIR.'/'.$s->{dir}.$s->{name};
} else {
$main::DIR.'/'.$s->{name};
}
my ($file, $dir) = fileparse($path);
$dir = '' if $dir eq './';
+ $dir =~ s{^/}{};
my $loc = $main::LOCALPATH.'/'.$main::DIR.'/'.$dir;
make_path($loc);