Skip to content

Commit

Permalink
Merge pull request #132 from Perl-Toolchain-Gang/bug/fix_t_directory_…
Browse files Browse the repository at this point in the history
…check

Better check for t/ directory in Perl handler
  • Loading branch information
craigberry authored Aug 4, 2024
2 parents 8704991 + b6a69d3 commit dc37fbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/TAP/Parser/SourceHandler/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ sub can_handle {
return 0.8 if $file->{lc_ext} eq '.t'; # vote higher than Executable
return 0.9 if $file->{lc_ext} eq '.pl';

return 0.75 if $file->{dir} =~ /^t\b/; # vote higher than Executable
my @dirs = File::Spec->splitdir($file->{dir});
return 0.75 if scalar(@dirs) && $dirs[0] eq 't'; # vote higher than Executable

# backwards compat, always vote:
return 0.25;
Expand Down

0 comments on commit dc37fbf

Please sign in to comment.