Skip to content

Commit

Permalink
Merge pull request #167 from neilb/taint-support
Browse files Browse the repository at this point in the history
Skip taint tests if your perl was built without taint support
  • Loading branch information
dankogai authored Mar 7, 2022
2 parents 225c482 + 4acd408 commit 0c79518
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/taint.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ use Encode qw(encode decode);
local %Encode::ExtModule = %Encode::Config::ExtModule;
use Scalar::Util qw(tainted);
use Test::More;
use Config;
my $taint = substr($ENV{PATH},0,0);
my $str = "dan\x{5f3e}" . $taint; # tainted string to encode
my $bin = encode('UTF-8', $str); # tainted binary to decode
my $notaint = "";
my $notaint_str = "dan\x{5f3e}" . $notaint;
my $notaint_bin = encode('UTF-8', $notaint_str);
my @names = Encode->encodings(':all');
plan tests => 4 * @names + 2;
if (exists($Config{taint_support}) && not $Config{taint_support}) {
plan skip_all => "your perl was built without taint support";
}
else {
plan tests => 4 * @names + 2;
}
for my $name (@names) {
my ($d, $e, $s);
eval {
Expand Down

0 comments on commit 0c79518

Please sign in to comment.