Skip to content

Commit

Permalink
Check for successful creation of symlink
Browse files Browse the repository at this point in the history
Symlink creation fails in certain Windows environments (and of course if respective permissions are not available). t/07-symlinks.t now checks for successful creation of the necessary symlink and skips tests if that failed.

Addresses issue #9.
  • Loading branch information
crenz committed Jul 30, 2022
1 parent 5b89c8e commit 9a5e343
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/07-symlinks.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ my $dirName = "ModuleFindTest";
my $linkName = "./t/test/ModuleFindTestSymLink";

SKIP: {
eval { symlink($dirName, $linkName) };
my $r = eval { symlink($dirName, $linkName) };
skip "Symlinks not supported on this system", 13 if $@;
skip "Unable to create symlink", 13 if $r == 0;

my @l;

# Default behaviour: follow symlinks -----------------------
@l = findsubmod ModuleFindTestSymLink;
ok($#l == 0);
Expand Down Expand Up @@ -48,7 +49,6 @@ SKIP: {
ok($l[1] eq 'ModuleFindTestSymLink::SubMod::SubSubMod');



# Clean up
unlink $linkName;
ok(!-e $linkName);
Expand Down

0 comments on commit 9a5e343

Please sign in to comment.