This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix /test_bootstrap.t under -DPERL_NO_COW
authorDavid Mitchell <davem@iabyn.com>
Fri, 19 Jul 2013 20:44:32 +0000 (21:44 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 28 Jul 2013 09:33:39 +0000 (10:33 +0100)
commit9a8c1c8ced8bc0d4970288efad5639bc8c5ce85a
tree86c48dbc19cf3910be053b2eb29866dab3a9f231
parent3ff69bd60a3227fd6f6dbd653d028e5b4c5e86f9
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.
t/porting/test_bootstrap.t
t/test.pl