summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-23 15:52:27 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-23 15:52:27 +0000
commit25aae3a72e52ac6a70711f3dce68629d59f1cf87 (patch)
tree1b826e757d9a19af45034f049d6b9b519b495458
parente80b829c678662da5bda5d8b6fb6d7de54064909 (diff)
downloadperl-25aae3a72e52ac6a70711f3dce68629d59f1cf87.tar.gz
Remove -T from op/subst.t, and add a new test file, substT.t,
to run the s/// tests under taint mode; mark the test for RT #6006 as TODO, but only with -T. p4raw-id: //depot/perl@29618
-rw-r--r--MANIFEST1
-rwxr-xr-xt/op/subst.t5
-rw-r--r--t/op/substT.t9
3 files changed, 14 insertions, 1 deletions
diff --git a/MANIFEST b/MANIFEST
index 67bcaae5fd..a35efa7f7e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3589,6 +3589,7 @@ t/op/sub_lval.t See if lvalue subroutines work
t/op/subst_amp.t See if $&-related substitution works
t/op/substr.t See if substr works
t/op/subst.t See if substitution works
+t/op/substT.t See if substitution works with -T
t/op/subst_wamp.t See if substitution works with $& present
t/op/sub.t See if subroutines work
t/op/switch.t See if switches (given/when) work
diff --git a/t/op/subst.t b/t/op/subst.t
index b4a824eb39..39f160df93 100755
--- a/t/op/subst.t
+++ b/t/op/subst.t
@@ -1,4 +1,4 @@
-#!./perl -wT
+#!./perl -w
BEGIN {
chdir 't' if -d 't';
@@ -563,11 +563,14 @@ is($name, "cis", q[#22351 bug with 'e' substitution modifier]);
is($c, "\x20\x30\x40\x50\x60", "s/[\\x00-\\x1f]//g");
}
{
+ {
+ local our $TODO = ${^TAINT} ? "doesn't work with taint mode" : 0;
$_ = "xy";
no warnings 'uninitialized';
/(((((((((x)))))))))(z)/; # clear $10
s/(((((((((x)))))))))(y)/${10}/;
is($_,"y","RT#6006: \$_ eq '$_'");
+ }
$_ = "xr";
s/(((((((((x)))))))))(r)/fooba${10}/;
is($_,"foobar","RT#6006: \$_ eq '$_'");
diff --git a/t/op/substT.t b/t/op/substT.t
new file mode 100644
index 0000000000..82e035465f
--- /dev/null
+++ b/t/op/substT.t
@@ -0,0 +1,9 @@
+#!perl -wT
+
+for $file ('op/subst.t', 't/op/subst.t', ':op:subst.t') {
+ if (-r $file) {
+ do ($^O eq 'MacOS' ? $file : "./$file");
+ exit;
+ }
+}
+die "Cannot find op/subst.t or t/op/subst.t\n";