Skip to content

Commit

Permalink
Better check for t/ directory in Perl handler
Browse files Browse the repository at this point in the history
The simple pattern match doesn't work on VMS, where the directory
name will be something like [.t.sample-tests].  So use the
available facilities to parse the directories.
  • Loading branch information
craigberry committed Jul 30, 2024
1 parent 8704991 commit b6a69d3
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 b6a69d3

Please sign in to comment.