Skip to content

Commit f31afb2

Browse files
committed
Restore one previously deleted test
"computed goto" Addresses: GH #23805
1 parent ce63dfb commit f31afb2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

t/op/goto.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BEGIN {
1212
use warnings;
1313
use strict;
1414
use Config;
15-
plan tests => 51;
15+
plan tests => 52;
1616

1717
our $TODO;
1818

@@ -221,6 +221,12 @@ returned_label:
221221
is($count, 1, 'called i_return_a_label');
222222
ok($ok, 'skipped to returned_label');
223223

224+
{
225+
# test of "computed 'goto'"
226+
my $wherever = 'NOWHERE';
227+
eval { goto $wherever };
228+
like($@, qr/Can't find label NOWHERE/, 'goto NOWHERE sets $@');
229+
}
224230

225231
# This bug was introduced in Aug 2010 by commit ac56e7de46621c6f
226232
# Peephole optimise adjacent pairs of nextstate ops.

0 commit comments

Comments
 (0)