mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
23 lines
411 B
Go
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")
|
|
}
|
|
}
|
|
}
|