From: Nicholas Clark Date: Mon, 28 Feb 2011 14:05:38 +0000 (+0000) Subject: Correct taint.t to skip the truncate test if $Config{d_truncate} is false. X-Git-Tag: accepted/trunk/20130322.191538~5253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2b4a08c75901ae8a8a00efe0bd4b0503f5d38d2;p=platform%2Fupstream%2Fperl.git Correct taint.t to skip the truncate test if $Config{d_truncate} is false. 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. --- diff --git a/t/op/taint.t b/t/op/taint.t index 100d4f7..a940493 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -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/, $@;