From e75436bfac7b4a53ab5cdbe3480311e33f29ceed Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 28 Feb 2011 11:57:32 +0000 Subject: [PATCH] In taint.t, replace calls to all_tainted() with a loop over is_tainted(). --- t/op/taint.t | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/t/op/taint.t b/t/op/taint.t index a6c770a..241817f 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); -- 2.7.4