Archive-Par

 view release on metacpan or  search on metacpan

t/moved.t  view on Meta::CPAN


use strict;

=head1 Unit Test Package for Archive::Par

This package tests the handling of pars with corrupt source files of
Archive::Par.

=cut

use Fatal                    1.02 qw( chmod unlink );
use File::Compare          1.1002 qw( cmp );
use File::Copy               2.03 qw( cp mv );
use File::Spec::Functions         qw( catfile rel2abs );
use FindBin                  1.42 qw( $Bin );
use Test                     1.13 qw( ok plan skip );

use lib $Bin;

use test qw( DATA_DIR REF_DIR
             evcheck );

t/moved.t  view on Meta::CPAN

    for $old1, $old2;
}

unless ( $skip ) {
  for (2,4) {
    mv catfile(DATA_DIR, "miffy.$_"), catfile(DATA_DIR, "miffy-moved.$_");
  }
  for (map "miffy.$_", 1,3..5) {
    my $stat = (stat($_))[2] & 0777;
    my $target = catfile(DATA_DIR, $_);
    chmod 0600, $target
      if -e $target; # #4 should be gone
    cp $_, $target
      or die sprintf "Failed to move %s -> %s: $!", $_, $target;
    chmod $stat, $target;
  }
}

# -------------------------------------



( run in 0.235 second using v1.01-cache-2.11-cpan-496ff517765 )