Files
expr/vm/program_test.go
T
2022-10-25 23:47:11 +02:00

23 lines
411 B
Go

package vm_test
import (
"strings"
"testing"
"github.com/antonmedv/expr/vm"
)
func TestProgram_Disassemble(t *testing.T) {
for op := vm.OpPush; op < vm.OpEnd; op++ {
program := vm.Program{
Constants: []interface{}{true},
Bytecode: []vm.Opcode{op},
Arguments: []int{0},
}
d := program.Disassemble()
if strings.Contains(d, "\t0x") {
t.Errorf("cannot disassemble all opcodes")
}
}
}