Skip to content

Commit 5cc1501

Browse files
committed
Test nqp::getlexouter with dynamic variables
1 parent c2cea52 commit 5cc1501

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

t/nqp/101-lexpad-stuff.t

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plan(12);
1+
plan(14);
22
sub more-inner() {
33
my $outer := nqp::ctxcaller(nqp::ctx());
44
my $outermost := nqp::ctxcaller(nqp::ctxcaller(nqp::ctx()));
@@ -57,6 +57,20 @@ outer();
5757
}
5858
}
5959

60+
{
61+
my $*foo := 101;
62+
my $*bar := 105;
63+
{
64+
my $*bar := 102;
65+
{
66+
my $*bar := 103;
67+
my $*foo := 104;
68+
ok(nqp::getlexouter('$*bar') == 102, 'getlexouter from immediately nested block with dynamic variable');
69+
ok(nqp::getlexouter('$*foo') == 101, 'getlexouter from a not immediate parent with dynamic variable');
70+
}
71+
}
72+
}
73+
6074
{
6175
my $*foo := 302;
6276
{

0 commit comments

Comments
 (0)