summaryrefslogtreecommitdiff
path: root/t/op/taint.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/taint.t')
-rwxr-xr-xt/op/taint.t23
1 files changed, 22 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index 8ae8202966..d010afea99 100755
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -15,6 +15,20 @@ BEGIN {
use strict;
use Config;
+my $test = 177;
+sub ok {
+ my($ok, $name) = @_;
+
+ # You have to do it this way or VMS will get confused.
+ print $ok ? "ok $test - $name\n" : "not ok $test - $name\n";
+
+ printf "# Failed test at line %d\n", (caller)[2] unless $ok;
+
+ $test++;
+ return $ok;
+}
+
+
$| = 1;
# We do not want the whole taint.t to fail
@@ -109,7 +123,7 @@ print PROG 'print "@ARGV\n"', "\n";
close PROG;
my $echo = "$Invoke_Perl $ECHO";
-print "1..176\n";
+print "1..179\n";
# First, let's make sure that Perl is checking the dangerous
# environment variables. Maybe they aren't set yet, so we'll
@@ -885,3 +899,10 @@ else {
}
+ok( ${^TAINT}, '$^TAINT is on' );
+
+eval { ${^TAINT} = 0 };
+ok( ${^TAINT}, '$^TAINT is not assignable' );
+ok( $@ =~ /^Modification of a read-only value attempted/,
+ 'Assigning to taint pukes properly' );
+