Skip to content

Commit b6a69d3

Browse files
committed
Better check for t/ directory in Perl handler
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.
1 parent 8704991 commit b6a69d3

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)