diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-12-03 09:19:32 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-12-03 09:19:32 +0000 |
commit | 302c0c93356e52f02a8925ac90ae96bf8db31000 (patch) | |
tree | 8406b1362921eeb28fbc1df1e2e355783a0ead35 /t | |
parent | eb044b10917d0598b3201b68e4a5d3ba7d124ef3 (diff) | |
download | perl-302c0c93356e52f02a8925ac90ae96bf8db31000.tar.gz |
Fix for tainting regression in a test of Text::Template spotted by
Andreas' smoker.
p4raw-id: //depot/perl@34987
Diffstat (limited to 't')
-rwxr-xr-x | t/op/taint.t | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 29fc4362a0..2dc1bb9883 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ use Config; use File::Spec::Functions; BEGIN { require './test.pl'; } -plan tests => 271; +plan tests => 298; $| = 1; @@ -1267,6 +1267,42 @@ foreach my $ord (78, 163, 256) { ok(!tainted($b), "untainted complement"); } +{ + my @data = qw(bonk zam zlonk qunckkk); + # Clearly some sort of usenet bang-path + my $string = $TAINT . join "!", @data; + + ok(tainted($string), "tainted data"); + + my @got = split /!|,/, $string; + + # each @got would be useful here, but I want the test for earlier perls + for my $i (0 .. $#data) { + ok(tainted($got[$i]), "tainted result $i"); + is($got[$i], $data[$i], "correct content $i"); + } + + ok(tainted($string), "still tainted data"); + + my @got = split /[!,]/, $string; + + # each @got would be useful here, but I want the test for earlier perls + for my $i (0 .. $#data) { + ok(tainted($got[$i]), "tainted result $i"); + is($got[$i], $data[$i], "correct content $i"); + } + + ok(tainted($string), "still tainted data"); + + my @got = split /!/, $string; + + # each @got would be useful here, but I want the test for earlier perls + for my $i (0 .. $#data) { + ok(tainted($got[$i]), "tainted result $i"); + is($got[$i], $data[$i], "correct content $i"); + } +} + # This may bomb out with the alarm signal so keep it last SKIP: { skip "No alarm()" unless $Config{d_alarm}; |