diff options
Diffstat (limited to 'dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t')
-rw-r--r-- | dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t b/dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t index e9e7e59650..3de8d9d3b9 100644 --- a/dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t +++ b/dist/ExtUtils-ParseXS/t/101-standard_typemap_locations.t @@ -17,7 +17,20 @@ use ExtUtils::ParseXS::Utilities qw( skip "No lib/ExtUtils/ directories under directories in \@INC", 1 unless @stl > 9; - ok( -f $stl[-10], + + # We check only as many location entries from the start of the array + # (where the @INC-related entries are) as there are entries from @INC. + # We manage to do that by stopping when we find the "updir" related + # entries, which we assume is never contained in a default @INC entry. + my $updir = File::Spec->updir; + my $max = $#INC; + $max = $#stl if $#stl < $max; + foreach my $i (0.. $max) { + $max = $i, last if $stl[$i] =~ /\Q$updir\E/; + } + + ok( + ( 0 < (grep -f $_, @stl[0..$max]) ), "At least one typemap file exists underneath \@INC directories" ); } |