neo-go/pkg/vm/opcode/opcode_test.go
Roman Khimov 8d4dd2d2e1 vm: move opcodes into their own package
This allows easier reuse of opcodes and in some cases allows to eliminate
dependencies on the whole vm package, like in compiler that only needs opcodes
and doesn't care about VM for any other purpose.

And yes, they're opcodes because an instruction is a whole thing with
operands, that's what context.Next() returns.
2019-12-03 18:22:14 +03:00

20 lines
346 B
Go

package opcode
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Nothing more to test here, really.
func TestStringer(t *testing.T) {
tests := map[Opcode]string{
ADD: "ADD",
SUB: "SUB",
THROWIFNOT: "THROWIFNOT",
0xff: "Opcode(255)",
}
for o, s := range tests {
assert.Equal(t, s, o.String())
}
}