Skip to content

Commit

Permalink
Merge pull request #50 from cpants/fix/skip_manifest_test
Browse files Browse the repository at this point in the history
Skip t/analyse/manifest.t if Test::File is not installed under Win32
  • Loading branch information
charsbar authored Sep 10, 2023
2 parents d49c652 + 4e44323 commit a2e7ea6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
cpanm --installdeps --with-develop --notest .
# --with-configure
# --with-recommends, --with-suggests
cpanm -n Test::File
- name: Run tests
#env:
Expand Down
11 changes: 9 additions & 2 deletions t/analyse/manifest.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ use FindBin;
use lib "$FindBin::Bin/../lib";
use Module::CPANTS::TestAnalyse;

my $no_symlinks;
if ($^O eq 'MSWin32') {
plan skip_all => 'requires Test::File 1.993 to test' unless eval { require Test::File; Test::File->VERSION(1.993) };

$no_symlinks = !Test::File::has_symlinks();
}

test_distribution {
my ($mca, $dir) = @_;
write_file("$dir/MANIFEST", <<"EOF");
Expand Down Expand Up @@ -58,7 +65,7 @@ EOF

my $stash = $mca->run;
ok !$stash->{error}{symlinks}, "symlinks not listed in MANIFEST is ignored for a local distribution";
};
} unless $no_symlinks;

test_distribution {
my ($mca, $dir) = @_;
Expand All @@ -75,6 +82,6 @@ EOF
my $stash = archive_and_analyse($dir, "Module-CPANTS-Analyse-Test-0.01.tar.gz");

ok $stash->{error}{symlinks}, "symlinks not listed in MANIFEST is not ignored for a non-local distribution";
};
} unless $no_symlinks;

done_testing;

0 comments on commit a2e7ea6

Please sign in to comment.