Skip to content

Commit

Permalink
Lower scores for +x test files so that we can pipe files with a shebang
Browse files Browse the repository at this point in the history
through perl without inlating shebang's score.
  • Loading branch information
AndyA committed Jul 28, 2010
1 parent 1505697 commit 7038535
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/TAP/Parser/SourceHandler/Executable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ sub can_handle {

# Note: we go in low so we can be out-voted
return 0.8 if $file->{lc_ext} eq '.bat';
return 0.7 if $file->{execute};
return 0.25 if $file->{execute};
}
elsif ( $meta->{is_hash} ) {
return 0.9 if $src->raw->{exec};
Expand Down
2 changes: 1 addition & 1 deletion lib/TAP/Parser/SourceHandler/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub can_handle {
# previous semantics: we used to execute everything via Perl and
# relied on it to pass the shebang off to the appropriate
# interpreter.
return 0.75;
return 0.3;
}

return 0.8 if $file->{lc_ext} eq '.t'; # vote higher than Executable
Expand Down
2 changes: 1 addition & 1 deletion t/source_handler.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
is_file => 1,
file => { lc_ext => '', execute => 1 }
},
vote => 0.7,
vote => 0.25,
},
{ name => 'exec hash',
raw => { exec => 'foo' },
Expand Down

0 comments on commit 7038535

Please sign in to comment.