File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
- plan (6 );
1
+ plan (9 );
2
2
my $ outer := " hello there" ;
3
3
sub foo () {
4
4
my $ foo := " hello" ;
@@ -7,11 +7,15 @@ sub foo() {
7
7
ok (nqp ::atkey($ lexpad ,' $foo' ) eq " hello" ," accessing a variable using nqp::curlexpad()" );
8
8
ok (nqp ::atkey($ lexpad ,' $bar' ) eq " hi" ," accessing a different variable using nqp::curlexpad()" );
9
9
10
+ ok (! nqp ::existskey($ lexpad , ' $outer' ), " nqp::existskey on a outer variable in a lexpad" );
10
11
ok (nqp ::existskey($ lexpad , ' $foo' ), " nqp::existskey on a lexpad with a variable that does exists" );
11
12
ok (! nqp ::existskey($ lexpad , ' $no_such_var_ever' ), " nqp::existskey on a lexpad with a variable that doesn't exist" );
12
13
13
14
nqp ::bindkey($ lexpad ,' $foo' , ' ciao' );
14
15
ok ($ foo eq ' ciao' , " binding to a variable using curlexpad" );
16
+
17
+ ok (nqp ::getlexrel($ lexpad , ' $bar' ) eq ' hi' , ' accessing a variable using getlexrel' );
18
+ ok (nqp ::isnull(nqp ::getlexrel($ lexpad , ' $no_such' )), ' nqp::getlexrel returns null for a missing variable' );
15
19
$ lexpad ;
16
20
}
17
21
my $ pad := foo();
You can’t perform that action at this time.
0 commit comments