From 61965f1d7ce73bac298dbea9d5df1d787777d222 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 12 Aug 2013 20:07:33 -0700 Subject: [PATCH] [perl #45667] Apply tests from #119125 in reverse MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ticket #119125 represents the breakage caused by c30fc27b4df65a, which fixed #45667 (/[#]$not_interpolated/x; a regression from 5.000) as a side-effect of fixing /[#](?{this is not a code block})/x (a regres- sion from 5.16.0). It was backported to maint-5.18, which broke several modules, because bug #45667 is *old*, and many modules depend on it. So 02682386fe3e on the maint branch modified the fix to apply only to code blocks, and added tests to make sure that #45667 wasn’t fixed. #45667 is fixed in blead, but is untested, so grab the tests from 02682386fe3e and reverse the logic of the second one. --- t/re/pat.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/re/pat.t b/t/re/pat.t index 777960b..4426caa 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -20,7 +20,7 @@ BEGIN { require './test.pl'; } -plan tests => 694; # Update this when adding/deleting tests. +plan tests => 696; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1451,6 +1451,18 @@ EOP } + { + # RT #45667 + # /[#$x]/x didn't interpolate the var $x. + my $b = 'cd'; + my $s = 'abcd$%#&'; + $s =~ s/[a#$b%]/X/g; + is ($s, 'XbXX$XX&', 'RT #45667 without /x'); + $s = 'abcd$%#&'; + $s =~ s/[a#$b%]/X/gx; + is ($s, 'XbXX$XX&', 'RT #45667 with /x'); + } + } # End of sub run_tests 1; -- 1.8.3.1