In taint.t, replace calls to all_tainted() with a loop over is_tainted().
authorNicholas Clark <nick@ccl4.org>
Mon, 28 Feb 2011 11:57:32 +0000 (11:57 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 2 Mar 2011 09:13:23 +0000 (09:13 +0000)
t/op/taint.t

index a6c770a..241817f 100644 (file)
@@ -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);