File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# Test nqp::op pseudo-functions.
4
4
5
- plan (94 );
5
+ plan (101 );
6
6
7
7
8
8
ok ( nqp ::add_i(5 ,2 ) == 7 , ' nqp::add_i' );
@@ -129,3 +129,14 @@ my %hash;
129
129
% hash <foo > := 1 ;
130
130
ok ( nqp ::existskey(% hash ," foo" )," existskey with existing key" );
131
131
ok ( ! nqp ::existskey(% hash ," bar" )," existskey with missing key" );
132
+
133
+ my @ arr ;
134
+ @ arr [1 ] := 3 ;
135
+ ok (! nqp ::existspos(@ arr , 0 ), ' existspos with missing pos' );
136
+ ok (nqp ::existspos(@ arr , 1 ), ' existspos with existing pos' );
137
+ ok (! nqp ::existspos(@ arr , 2 ), ' existspos with missing pos' );
138
+ ok (nqp ::existspos(@ arr , -1 ), ' existspos with existing pos' );
139
+ ok (! nqp ::existspos(@ arr , -2 ), ' existspos with missing pos' );
140
+ ok (! nqp ::existspos(@ arr , -100 ), ' existspos with absurd values' );
141
+ @ arr [1 ] := NQPMu;
142
+ ok (nqp ::existspos(@ arr , 1 ), ' existspos with still existing pos' );
You can’t perform that action at this time.
0 commit comments