summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-07-19 21:44:32 +0100
committerDavid Mitchell <davem@iabyn.com>2013-07-28 10:33:39 +0100
commit9a8c1c8ced8bc0d4970288efad5639bc8c5ce85a (patch)
tree86c48dbc19cf3910be053b2eb29866dab3a9f231 /t/test.pl
parent3ff69bd60a3227fd6f6dbd653d028e5b4c5e86f9 (diff)
downloadperl-9a8c1c8ced8bc0d4970288efad5639bc8c5ce85a.tar.gz
fix /test_bootstrap.t under -DPERL_NO_COW
These tests check whether "require test.pl" inadvertently use $& etc. They do that by doing a simple pattern match "Perl/ =~ /Perl/, then checking that eval '$&' returns undef. This has always been a dodgy thing o rely on. It turns out that under 5.18.0, whether eval '$&' was undef depended on whether the intuit-only- match codepath was taken. So: "Perl" =~ /Perl/; eval '$&'; # intuit-only match: returned undef "Perl" =~ /\w+\w*/; eval '$&'; # regexec() match: returned 'Perl'. In this branch, the same code path is now used for both intuit() and regexec() matches, so both return 'Perl'. So, abandon this approach to the test, and instead read in tets.pl and grep for the test '$&' etc. Requires minor fixup to test.pl to avoid a false positive.
Diffstat (limited to 't/test.pl')
-rw-r--r--t/test.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/test.pl b/t/test.pl
index eb4f868fa4..89c1d4dc8f 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -827,7 +827,7 @@ sub tempfile {
return $try;
}
}
- die "Can't find temporary file name starting 'tmp$$'";
+ die "Can't find temporary file name starting \"tmp$$\"";
}
# This is the temporary file for _fresh_perl