summaryrefslogtreecommitdiff
path: root/t/re/subst.t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2018-03-07 09:27:26 +0000
committerDavid Mitchell <davem@iabyn.com>2018-03-07 09:27:26 +0000
commit823ba440369100de3f2693420a3887a645a57d28 (patch)
treeae48fe64ef5a4f652ef0133e707e421f5bf81a72 /t/re/subst.t
parent32ce30d709666239149a4f04ddcfbdec00005288 (diff)
downloadperl-823ba440369100de3f2693420a3887a645a57d28.tar.gz
fix line numbers in multi-line s///
my commit v5.25.6-230-g6432a58, "Eliminate SVrepl_EVAL and SvEVALED()", introduced a regression: __LINE__ no longer took account of multiple lines in the s///. Now fixed. Spotted by Abigail.
Diffstat (limited to 't/re/subst.t')
-rw-r--r--t/re/subst.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/re/subst.t b/t/re/subst.t
index b9b9939b11..dd62e95ee6 100644
--- a/t/re/subst.t
+++ b/t/re/subst.t
@@ -11,7 +11,7 @@ BEGIN {
require './loc_tools.pl';
}
-plan(tests => 275);
+plan(tests => 276);
$_ = 'david';
$a = s/david/rules/r;
@@ -1163,6 +1163,16 @@ __EOF__
pass("RT #130188");
}
+# RT #131930
+# a multi-line s/// wasn't resetting the cop_line correctly
+{
+ my $l0 = __LINE__;
+ my $s = "a";
+ $s =~ s[a]
+ [b];
+ my $lines = __LINE__ - $l0;
+ is $lines, 4, "RT #131930";
+}