From: Nicholas Clark Date: Tue, 6 Sep 2005 17:46:33 +0000 (+0000) Subject: Add a TODO test for bug #37038 - assigning to the match variable X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=740266bff261335d346cbafd47b3f0ad938f70d0;p=p5sagit%2Fp5-mst-13.2.git Add a TODO test for bug #37038 - assigning to the match variable should not corrupt match vars such as $1 and $2 p4raw-id: //depot/perl@25360 --- diff --git a/t/op/pat.t b/t/op/pat.t index fb0d5fe..10ecaf8 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..1186\n"; +print "1..1187\n"; BEGIN { chdir 't' if -d 't'; @@ -3382,4 +3382,16 @@ ok(("foba ba$s" =~ qr/(foo|BaSS|bar)/i) ok($latin1 =~ /(abc|$utf8)/i, "# latin/utf8 trie runtime"); } -# last test 1186 +# [perl #37038] Global regular matches generate invalid pointers + +{ + my $s = "abcd"; + $s =~ /(..)(..)/g; + $s = $1; + $s = $2; + ok($s eq 'cd', + "# TODO assigning to original string should not corrupt match vars"); +} + +# last test 1187 +