summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-02-28 11:57:32 +0000
committerNicholas Clark <nick@ccl4.org>2011-03-02 09:13:23 +0000
commite75436bfac7b4a53ab5cdbe3480311e33f29ceed (patch)
treea3de22cf0cf474377cf77223f52efb7b53892f16
parentf37ea7f04777a04e146f97260aa398fdc289dfdb (diff)
downloadperl-e75436bfac7b4a53ab5cdbe3480311e33f29ceed.tar.gz
In taint.t, replace calls to all_tainted() with a loop over is_tainted().
-rw-r--r--t/op/taint.t14
1 files changed, 6 insertions, 8 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index a6c770a7d9..241817fe8e 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 => 706;
+plan tests => 712;
$| = 1;
@@ -103,10 +103,6 @@ sub any_tainted (@) {
sub tainted ($) {
any_tainted @_;
}
-sub all_tainted (@) {
- for (@_) { return 0 unless tainted $_ }
- 1;
-}
sub is_tainted {
my $thing = shift;
@@ -235,7 +231,7 @@ my $TEST = catfile(curdir(), 'TEST');
ok(not any_tainted @list);
taint_these @list[1,3,5,7,9];
ok(any_tainted @list);
- ok(all_tainted @list[1,3,5,7,9]);
+ is_tainted($_) foreach @list[1,3,5,7,9];
ok(not any_tainted @list[0,2,4,6,8]);
($foo) = $foo =~ /(.+)/;
@@ -1001,7 +997,8 @@ SKIP: {
# Certain system variables should be tainted
{
- ok(all_tainted $^X, $0);
+ is_tainted($^X);
+ is_tainted($0);
}
# Results of matching should all be untainted
@@ -1206,7 +1203,8 @@ SKIP: {
{
my $foo = $TAINT0;
my $bar = $foo;
- ok(all_tainted $foo, $bar);
+ is_tainted($foo);
+ is_tainted($bar);
is_tainted($foo = $bar);
is_tainted($bar = $bar);
is_tainted($bar += $bar);