todo test for GH 20491 (defer inside do block is broken)

This commit adds a todo test for GH 20491. It tests that a defer block
in a single-expression do block runs when exiting said do block,
instead of the block holding the do block.
This commit is contained in:
Samuel Young 2025-09-04 18:49:09 -05:00 committed by Karl Williamson
parent 2328936474
commit 7cdc183e0e

View File

@ -351,6 +351,16 @@ TODO: {
isnt($?, 0, 'Compilation fails; GH 19378');
}
TODO: {
local $::TODO = 'GH 20491';
use experimental 'defer';
my $deferred = 0;
do {
defer { $deferred = 1 };
};
is($deferred, 1, 'defer in single-expression do block runs when exiting block; GH 20491');
}
TODO: {
todo_skip 1 if is_miniperl();
local $::TODO = 'GH 22168';