2021-03-18 09:53:22 +03:00
|
|
|
package encoder
|
2021-02-01 16:34:53 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDumpOpcode(t *testing.T) {
|
2022-01-03 06:33:51 +03:00
|
|
|
ctx := TakeRuntimeContext()
|
|
|
|
defer ReleaseRuntimeContext(ctx)
|
2021-02-01 16:34:53 +03:00
|
|
|
var v interface{} = 1
|
2021-03-13 08:12:31 +03:00
|
|
|
header := (*emptyInterface)(unsafe.Pointer(&v))
|
2021-02-01 16:34:53 +03:00
|
|
|
typ := header.typ
|
|
|
|
typeptr := uintptr(unsafe.Pointer(typ))
|
2022-01-03 06:33:51 +03:00
|
|
|
codeSet, err := CompileToGetCodeSet(ctx, typeptr)
|
2021-02-01 16:34:53 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2021-05-29 08:47:18 +03:00
|
|
|
codeSet.EscapeKeyCode.Dump()
|
2021-02-01 16:34:53 +03:00
|
|
|
}
|