Correct taint.t to skip the truncate test if $Config{d_truncate} is false.
authorNicholas Clark <nick@ccl4.org>
Mon, 28 Feb 2011 14:05:38 +0000 (14:05 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 28 Feb 2011 14:05:38 +0000 (14:05 +0000)
Previously it had a comment, present since 5.003_92, that "There is no feature
test in $Config{} for truncate, so we allow for the possibility that it's
d missing."

This was never correct, as 5.000 had d_truncate, and taint.t had analogous
tests for $Config{d_chown} etc.

t/op/taint.t

index 100d4f7..a940493 100644 (file)
@@ -1040,10 +1040,12 @@ SKIP: {
     test !eval { chmod 0, $TAINT }, 'chmod';
     test $@ =~ /^Insecure dependency/, $@;
 
-    # There is no feature test in $Config{} for truncate,
-    #   so we allow for the possibility that it's missing.
-    test !eval { truncate 'NoSuChFiLe', $TAINT0 }, 'truncate';
-    test $@ =~ /^(?:Insecure dependency|truncate not implemented)/, $@;
+    SKIP: {
+        skip "truncate() is not available", 2 unless $Config{d_truncate};
+
+       test !eval { truncate 'NoSuChFiLe', $TAINT0 }, 'truncate';
+       test $@ =~ /^Insecure dependency/, $@;
+    }
 
     test !eval { rename '', $TAINT }, 'rename';
     test $@ =~ /^Insecure dependency/, $@;