diff options
Diffstat (limited to 'vm1')
| -rw-r--r-- | vm1/vm.go | 1 | ||||
| -rw-r--r-- | vm1/vm_test.go | 8 |
2 files changed, 6 insertions, 3 deletions
@@ -153,7 +153,6 @@ func (m *Machine) Run() (err error) { } ip++ } - return } func (m *Machine) PushCode(code [][]int64) (p int) { diff --git a/vm1/vm_test.go b/vm1/vm_test.go index cea4f29..257ac44 100644 --- a/vm1/vm_test.go +++ b/vm1/vm_test.go @@ -14,7 +14,9 @@ func TestVM(t *testing.T) { m.Push(v) } m.PushCode(test.code) - m.Run() + 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 { @@ -34,7 +36,9 @@ func BenchmarkVM(b *testing.B) { m.PushCode(test.code) b.StartTimer() - m.Run() + if err := m.Run(); err != nil { + b.Errorf("run error: %v", err) + } } }) } |
