diff options
author | David Mitchell <davem@iabyn.com> | 2013-07-19 21:44:32 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-07-28 10:33:39 +0100 |
commit | 9a8c1c8ced8bc0d4970288efad5639bc8c5ce85a (patch) | |
tree | 86c48dbc19cf3910be053b2eb29866dab3a9f231 /t/test.pl | |
parent | 3ff69bd60a3227fd6f6dbd653d028e5b4c5e86f9 (diff) | |
download | perl-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.pl | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |