This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e267fb
)
test that pp_leavesub copies returned PADTMPs.
author
David Mitchell
<davem@iabyn.com>
Wed, 21 Oct 2015 16:54:29 +0000
(17:54 +0100)
committer
David Mitchell
<davem@iabyn.com>
Wed, 3 Feb 2016 09:18:32 +0000
(09:18 +0000)
Although pp_leavesub() has in fact always done this, it was never actually
tested for.
t/op/sub.t
patch
|
blob
|
blame
|
history
diff --git
a/t/op/sub.t
b/t/op/sub.t
index
380334b
..
cc6501d
100644
(file)
--- a/
t/op/sub.t
+++ b/
t/op/sub.t
@@
-6,7
+6,7
@@
BEGIN {
set_up_inc('../lib');
}
-plan(tests => 6
0
);
+plan(tests => 6
1
);
sub empty_sub {}
@@
-383,3
+383,11
@@
is(join('-', 10, check_ret(-1,5)), "10", "check_ret(-1,5) list");
}->('a','b');
is(join('-', @res), "a-b", "unnested rubbish");
}
+
+# a sub should copy returned PADTMPs
+
+{
+ sub f99 { $_[0] . "x" };
+ my $a = [ f99(1), f99(2) ];
+ is("@$a", "1x 2x", "PADTMPs copied on return");
+}