Added a halt instruction test
This commit is contained in:
parent
a78c1dfcf1
commit
c77925a7e0
@ -183,3 +183,19 @@ func TestPeekPoke(test *testing.T) {
|
||||
test.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestHalt(test *testing.T) {
|
||||
machine := runMachineTest ([]int {
|
||||
PUSH, 32,
|
||||
HALT,
|
||||
PUSH, 3,
|
||||
}, nil, test)
|
||||
|
||||
result := machine.Pop()
|
||||
test.Log("popped:", result)
|
||||
|
||||
if result != 32 {
|
||||
test.Log("result should be", 32)
|
||||
test.Fail()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user