summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-06 02:11:02 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-06 10:21:42 -0800
commitd1299d44cb6299d416c31fa3425359d9a2c5d7c3 (patch)
tree4742f06660a230663d73fca5ce95a7da755a81d2 /t/comp
parent6bac172059b0ed213ca5326c1117d262ed34c1c1 (diff)
downloadperl-d1299d44cb6299d416c31fa3425359d9a2c5d7c3.tar.gz
Make multiple #line’s update dblines in evals
The array-copying stuff that happens when #line 3 "filename" is encountered in a string eval is not sufficient. If there are multiple such statements, only the first one copies the debugger’s lines arrays (@{"_<filename"}) into the new array. Checking that CopFILESV(PL_curcop) begins with ‘(eval ’ is a bit silly, since the parser already knows whether it’s processing a file without having to check file names. (And what if you have a real file beginning with ‘(eval ’?) See commit 8818d40 and others that it references, for the history of this piece of code.
Diffstat (limited to 't/comp')
-rw-r--r--t/comp/retainedlines.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/comp/retainedlines.t b/t/comp/retainedlines.t
index 240c5b177e..25687bed9e 100644
--- a/t/comp/retainedlines.t
+++ b/t/comp/retainedlines.t
@@ -6,7 +6,7 @@
# we've not yet verified that use works.
# use strict;
-print "1..73\n";
+print "1..74\n";
my $test = 0;
sub failed {
@@ -157,4 +157,7 @@ for (0xA, 0) {
eval qq{#line 42 "hash-line-eval"\n labadalabada()\n};
is $::{"_<hash-line-eval"}[42], " labadalabada()\n",
'#line 42 "foo" in a string eval updates @{"_<foo"}';
+ eval qq{#line 42 "figgle"\n#line 85 "doggo"\n labadalabada()\n};
+ is $::{"_<doggo"}[85], " labadalabada()\n",
+ 'subsequent #line 42 "foo" in a string eval updates @{"_<foo"}';
}