From b6a69d36b4f1fb5a20f8cdb3a0e9423fd6501c44 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Sat, 30 Mar 2024 15:31:02 -0500 Subject: [PATCH] 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. --- lib/TAP/Parser/SourceHandler/Perl.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/TAP/Parser/SourceHandler/Perl.pm b/lib/TAP/Parser/SourceHandler/Perl.pm index 11a6cb6f..7b66121a 100644 --- a/lib/TAP/Parser/SourceHandler/Perl.pm +++ b/lib/TAP/Parser/SourceHandler/Perl.pm @@ -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;