From: Vincent Pit Date: Sun, 26 Mar 2023 15:29:54 +0000 (+0200) Subject: Work around test failures in t/64-uplevel-caller.t X-Git-Tag: v0.34~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=06d56a7d75a0691e8cdc82f75841b4fcd5d8f7c9 Work around test failures in t/64-uplevel-caller.t This is probably related to the caller behaviour change re-re-introduced with core commit f6387cf. --- diff --git a/t/64-uplevel-caller.t b/t/64-uplevel-caller.t index 50a44d7..575ed3d 100644 --- a/t/64-uplevel-caller.t +++ b/t/64-uplevel-caller.t @@ -12,14 +12,18 @@ sub callstack { my $i = 1; my @stack; while (1) { - my @c = $check_args ? do { package DB; caller($i++) } - : caller($i++); + my @c = $check_args ? do { + my $frame = ("$]" >= 5.037_010) ? ($i + 1) : $i; + package DB; + caller($frame) + } : caller($i); last unless @c; if ($check_args) { my $args = $c[4] ? [ @DB::args ] : undef; push @c, $args; } push @stack, \@c; + ++$i; } return \@stack; }