X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/98830e71b322ee2b78a218cf29c6e32d7f94ff62..1738e041e86c4796d194727eae67369600abf920:/t/op/taint.t?ds=sidebyside diff --git a/t/op/taint.t b/t/op/taint.t index 3f014b3..aaf556a 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ BEGIN { use strict; use Config; -plan tests => 798; +plan tests => 800; $| = 1; @@ -1057,6 +1057,18 @@ my $TEST = 'TEST'; is($s, 'abcd', "$desc: s value"); is($res, 'xyz', "$desc: res value"); is($one, 'abcd', "$desc: \$1 value"); + + # [perl #121854] match taintedness became sticky + # when one match has a taintess result, subseqent matches + # using the same pattern shouldn't necessarily be tainted + + { + my $f = sub { $_[0] =~ /(.*)/ or die; $1 }; + $res = $f->($TAINT); + is_tainted($res, "121854: res tainted"); + $res = $f->("abc"); + isnt_tainted($res, "121854: res not tainted"); + } } $foo = $1 if 'bar' =~ /(.+)$TAINT/;