This commit is contained in:
2026-05-09 13:26:13 -05:00
parent 554a7b55c5
commit 610491c1d7
3 changed files with 51 additions and 16 deletions

View File

@@ -341,21 +341,21 @@ do TEST "VM: GC strings"
end
do TEST "VM: arrays"
local vm = VM.new():set_debug(true):load(assemble [
local vm = VM.new():set_debug(true):load(assemble [[
.func 0
newa
pushi 10
seta 0
seti 0
pushi 20
seta 1
seti 1
pushi 30
seta 2
geta 1
]):call(0)
seti 2
geti 1
ret
]]):call(0)
print(vm:debug_heap())
assert_eq(vm:to_integer(-1), 20)
assert_eq(vm:is(-2, 'array'), true)
assert_eq(vm.heap:size(), 1)
end