diff --git a/test/opcode_test.go b/test/opcode_test.go index 3af78aa..7068f51 100644 --- a/test/opcode_test.go +++ b/test/opcode_test.go @@ -153,3 +153,57 @@ functions: expectGlobalMemory(t, state, 1, 3) } + +func TestGTU(t *testing.T) { + state := assembleAndExecute(t, ` +functions: +- - [mov, g0, 5] + - [gtu, g0, 4] + - [jmpt, +2] + - [add, g1, 1] + - [gtu, g0, 5] + - [jmpt, +2] + - [add, g1, 2] + - [gtu, g0, 6] + - [jmpt, +2] + - [add, g1, 4] +`) + + expectGlobalMemory(t, state, 1, 6) +} + +func TestLTEU(t *testing.T) { + state := assembleAndExecute(t, ` +functions: +- - [mov, g0, 5] + - [lteu, g0, 4] + - [jmpt, +2] + - [add, g1, 1] + - [lteu, g0, 5] + - [jmpt, +2] + - [add, g1, 2] + - [lteu, g0, 6] + - [jmpt, +2] + - [add, g1, 4] +`) + + expectGlobalMemory(t, state, 1, 1) +} + +func TestGTEU(t *testing.T) { + state := assembleAndExecute(t, ` +functions: +- - [mov, g0, 5] + - [gteu, g0, 4] + - [jmpt, +2] + - [add, g1, 1] + - [gteu, g0, 5] + - [jmpt, +2] + - [add, g1, 2] + - [gteu, g0, 6] + - [jmpt, +2] + - [add, g1, 4] +`) + + expectGlobalMemory(t, state, 1, 4) +}