Skip to content

Commit

Permalink
TODO tests for $^A tainting
Browse files Browse the repository at this point in the history
The format accumulator $^A should become tainted when formline() is
called with tainted data.
  • Loading branch information
ntyni authored and Father Chrysostomos committed Nov 15, 2010
1 parent 00cb33d commit 99e6ea2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion t/op/taint.t
Expand Up @@ -17,7 +17,7 @@ use Config;
use File::Spec::Functions;

BEGIN { require './test.pl'; }
plan tests => 326;
plan tests => 335;

$| = 1;

Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 99e6ea2

Please sign in to comment.