Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Revision history for Rex
- Test rsync with wildcard in source path
- Add initial test for temp file names
- Simplify temp file naming logic
- Use set semantics for directory comparisons

1.11.0 2020-06-05 Ferenc Erki <[email protected]>
[BUG FIXES]
Expand Down
11 changes: 5 additions & 6 deletions t/rsync.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use Cwd qw(realpath);
use File::Basename qw(basename dirname);
use File::Find;
use File::Temp qw(tempdir);
use Test::Deep;

my %source_for = (
'rsync with absolute path' => realpath('t/sync'),
Expand Down Expand Up @@ -47,7 +48,7 @@ sub test_rsync {

my @empty = qw(. ..);

is_deeply( \@contents, \@empty, "$target is empty" );
cmp_deeply( \@contents, set(@empty), "$target is empty" );

# sync contents
sync $source, $target;
Expand All @@ -68,8 +69,7 @@ sub test_rsync {
# expected results
find(
{
preprocess => sub { sort @_ },
wanted => sub {
wanted => sub {
s/$prefix//;
push @expected, $_ if length($_);
},
Expand All @@ -81,8 +81,7 @@ sub test_rsync {
# actual results
find(
{
preprocess => sub { sort @_ },
wanted => sub {
wanted => sub {
s/$target//;
push @result, $_ if length($_);
},
Expand All @@ -91,6 +90,6 @@ sub test_rsync {
$target
);

is_deeply( \@result, \@expected, 'synced dir matches' );
cmp_deeply( \@result, set(@expected), 'synced dir matches' );
}
}