diff options
| author | Marc Vertes <mvertes@free.fr> | 2023-11-23 17:56:35 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2023-11-24 09:12:46 +0100 |
| commit | 6a32a7bc5f6320902cd5c2910a1353a0f7039237 (patch) | |
| tree | 0fcce51e4d4f54d48d57a5dda8a896a35264f68b /vm/vm_test.go | |
| parent | c548093d79edece3c1cbb7e4dc03d92fe45b1cc7 (diff) | |
parser: fix allocation of local variables
A 'New' instruction is added in VM to manage initialisation
of typed variables in the stack. The instantiated type symbols
are now added to global data. Accessing and setting values by
address is now working.
Diffstat (limited to 'vm/vm_test.go')
| -rw-r--r-- | vm/vm_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vm/vm_test.go b/vm/vm_test.go index c9540d2..07c063e 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -23,9 +23,8 @@ func TestVM(t *testing.T) { if err := m.Run(); err != nil { t.Errorf("run error: %v", err) } - t.Log(m.mem) - r := fmt.Sprintf("%v", m.mem[test.start:test.end]) - if r != test.mem { + t.Log(Vstring(m.mem)) + if r := Vstring(m.mem[test.start:test.end]); r != test.mem { t.Errorf("got %v, want %v", r, test.mem) } }) |
