Skip to content

Commit dc37fbf

Browse files
authored
Merge pull request #132 from Perl-Toolchain-Gang/bug/fix_t_directory_check
Better check for t/ directory in Perl handler
2 parents 8704991 + b6a69d3 commit dc37fbf

File tree

1 file changed

+2
-1
lines changed
  • lib/TAP/Parser/SourceHandler

1 file changed

+2
-1
lines changed

lib/TAP/Parser/SourceHandler/Perl.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ sub can_handle {
9292
return 0.8 if $file->{lc_ext} eq '.t'; # vote higher than Executable
9393
return 0.9 if $file->{lc_ext} eq '.pl';
9494

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

9798
# backwards compat, always vote:
9899
return 0.25;

0 commit comments

Comments
 (0)