neo-go/pkg/vm/stack/context_test.go
2019-03-15 22:32:08 +00:00

20 lines
359 B
Go

package stack
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNextInstruction(t *testing.T) {
// PUSHBYTES1 2
builder := NewBuilder()
builder.EmitBytes([]byte{0x02}) //[]byte{0x01, 0x02}
ctx := NewContext(builder.Bytes())
op := ctx.Next()
byt := ctx.readByte()
assert.Equal(t, PUSHBYTES1, op)
assert.Equal(t, byte(2), byt)
}