18 lines
231 B
Go
18 lines
231 B
Go
package test
|
|
|
|
import "testing"
|
|
|
|
func TestLoop(t *testing.T) {
|
|
state := assembleAndExecute(t, `
|
|
functions:
|
|
- - [add, f0, 1]
|
|
- [call, +1]
|
|
- [ltu, f0, 3]
|
|
- [jmpt, -3]
|
|
|
|
- - [add, g0, 1]
|
|
`)
|
|
|
|
expectGlobalMemory(t, state, 0, 3)
|
|
}
|