Add array tests

This commit is contained in:
0x4261756D 2022-12-22 00:48:02 +01:00
parent bf4a08e484
commit 8397d32756
5 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,5 @@
//invalid,Attempted an out of bounds read for array test (5 >= 4) at 5:12:END:
arr test { bool 4 }
5 test.read deq

View File

@ -0,0 +1,5 @@
//invalid,Attempted an out of bounds write for array test (5 >= 4) at 5:19:END:
arr test { bool 4 }
5 false test.write

View File

@ -0,0 +1,5 @@
//invalid,Attempted an out of bounds read for array test (-1 < 0) at 5:13:END:
arr test { bool 4 }
-1 test.read deq

View File

@ -0,0 +1,5 @@
//invalid,Attempted an out of bounds write for array test (-1 < 0) at 5:19:END:
arr test { bool 4 }
-1 true test.write

25
tests/array_tests.qbl Normal file
View File

@ -0,0 +1,25 @@
//valid,0000
//0100
//2100
//2103
//:END:
arr test { int 4 }
function => dump
{
true 0
while
{
dup test.read req print
1 + test.length dup < req
}
deq "" println
}
dump
1 1 test.write
dump
0 2 test.write
dump
3 3 test.write
dump