Example is in attachment, but problem is:
I rcopy some dir structure to other_dir, other_dir deleted and rcopy some data to other-other_dir, rcopy create empty other_dir...
Subject: | rcopy_bug.t |
use strict;
use warnings;
our $VERSION = '0.0.1';
use File::Spec::Functions qw(catfile);
use FindBin;
use Test::More tests => 3;
use File::Temp;
use File::Path qw(remove_tree);
use lib catfile($FindBin::Bin, '../../../lib');
use_ok('File::Copy::Recursive');
my $tmp = File::Temp->newdir();
my $a = catfile($tmp, 'a');
mkdir $a;
my $b = catfile($tmp, 'b');
my $c = catfile($tmp, 'c');
open my $FILE,'>', "$a/test";
close $FILE;
File::Copy::Recursive::rcopy($a, $b);
remove_tree($b);
ok(!-d $b, 'b is deleted');
note(qx("ls -al $tmp"));
File::Copy::Recursive::rcopy($a, $c);
ok(!-d $b, 'b is must be deleted too');
note(qx("ls -al $tmp"));