diff --git a/creature_test.go b/creature_test.go index 4ac4f94..e148dd4 100644 --- a/creature_test.go +++ b/creature_test.go @@ -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() + } +}