summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2023-05-01 14:48:20 +1000
committerPaul Evans <leonerd@leonerd.org.uk>2023-05-12 16:23:26 +0100
commit5462b17e4274b0f16b62d347717697c9e6ee193c (patch)
tree3acfd9d870e00c55ef4ce35d7edb7fe0d09df1cd
parenta12bd18fcb7a0a71c07c21e4028d7ee45474a8f9 (diff)
downloadperl-5462b17e4274b0f16b62d347717697c9e6ee193c.tar.gz
TODO test that sub return values are modifiable
Regression test for #21044
-rw-r--r--t/op/sub.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/sub.t b/t/op/sub.t
index b2839c6a40..0eae1d50de 100644
--- a/t/op/sub.t
+++ b/t/op/sub.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('../lib');
}
-plan(tests => 64);
+plan(tests => 65);
sub empty_sub {}
@@ -443,3 +443,10 @@ fresh_perl_like(
{},
"#6998 freeing array used as args to sub",
);
+
+# github #21044
+{
+ local $TODO = "sub return values not modifiable";
+ok( eval { $_->{x} = 1 for sub { undef }->(); 1 }, "check sub return values are modifiable")
+ or diag $@;
+}