summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@debian.org>2010-11-12 19:35:34 +0200
committerFather Chrysostomos <sprout@cpan.org>2010-11-14 16:52:23 -0800
commit99e6ea262e0d5e6a5eea5692f2b99d422027c0a4 (patch)
tree0399ca3f088732dc61657d583e5324851e72beaf /t
parent00cb33d673fd6261c17af74ca3ad5709dfc03b03 (diff)
downloadperl-99e6ea262e0d5e6a5eea5692f2b99d422027c0a4.tar.gz
TODO tests for $^A tainting
The format accumulator $^A should become tainted when formline() is called with tainted data.
Diffstat (limited to 't')
-rw-r--r--t/op/taint.t23
1 files changed, 22 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index 158824eb53..76e312fdac 100644
--- 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 => 326;
+plan tests => 335;
$| = 1;
@@ -1405,6 +1405,27 @@ end
"formline survives a tainted dynamic picture");
}
+TODO: {
+ local $::TODO = '$^A tainting unimplemented';
+ ok(!tainted($^A), "format accumulator not tainted yet");
+ formline('@ | @*', 'hallo' . $TAINT, 'welt');
+ ok(tainted($^A), "tainted formline argument makes a tainted accumulator");
+ $^A = "";
+ ok(!tainted($^A), "accumulator can be explicitly untainted");
+ formline('@' .('<'*5) . ' | @*', 'hallo', 'welt');
+ ok(!tainted($^A), "accumulator still untainted");
+ $^A = "" . $TAINT;
+ ok(tainted($^A), "accumulator can be explicitly tainted");
+ formline('@' .('<'*5) . ' | @*', 'hallo', 'welt');
+ ok(tainted($^A), "accumulator still tainted");
+ $^A = "";
+ ok(!tainted($^A), "accumulator untainted again");
+ formline('@' .('<'*5) . ' | @*', 'hallo', 'welt');
+ ok(!tainted($^A), "accumulator still untainted");
+ formline('@' .('<'*(5+$TAINT0)) . ' | @*', 'hallo', 'welt');
+ ok(tainted($^A), "tainted formline picture makes a tainted accumulator");
+}
+
# This may bomb out with the alarm signal so keep it last
SKIP: {
skip "No alarm()" unless $Config{d_alarm};