From: Peter Rabbitson Date: Mon, 30 May 2016 14:44:05 +0000 (+0200) Subject: Correct mistake in t/00describe_environment.t reporting of _TempExtlib X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7dc14bc09910cb750e5fe503dfa18a97eed490d1;p=dbsrgits%2FDBIx-Class-Historic.git Correct mistake in t/00describe_environment.t reporting of _TempExtlib This isn't actually correct, but is a reasonable approximation. The entire thing needs to be rewritten, but that's another fight --- diff --git a/t/00describe_environment.t b/t/00describe_environment.t index 21cf5d6..9a973de 100644 --- a/t/00describe_environment.t +++ b/t/00describe_environment.t @@ -600,12 +600,21 @@ sub module_found_at_inc_index { my $fn = module_notional_filename($mod); - for my $i ( 0 .. $#$inc_dirs ) { + # trust INC if it specifies an existing path + if( -f ( my $existing_path = abs_unix_path( $INC{$fn} ) ) ) { + for my $i ( 0 .. $#$inc_dirs ) { + + # searching from here on out won't mean anything + # FIXME - there is actually a way to interrogate this safely, but + # that's a fight for another day + return undef if length ref $inc_dirs->[$i]; + + return $i + if 0 == index( $existing_path, abs_unix_path( $inc_dirs->[$i] ) . '/' ); + } + } - # searching from here on out won't mean anything - # FIXME - there is actually a way to interrogate this safely, but - # that's a fight for another day - return undef if length ref $inc_dirs->[$i]; + for my $i ( 0 .. $#$inc_dirs ) { if ( -d $inc_dirs->[$i]