forked from mirror/go-json
Add test code
This commit is contained in:
parent
2a0d4603ea
commit
b6ffc2368a
|
@ -0,0 +1,18 @@
|
|||
package json
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func TestDumpOpcode(t *testing.T) {
|
||||
var v interface{} = 1
|
||||
header := (*interfaceHeader)(unsafe.Pointer(&v))
|
||||
typ := header.typ
|
||||
typeptr := uintptr(unsafe.Pointer(typ))
|
||||
codeSet, err := encodeCompileToGetCodeSet(typeptr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
codeSet.code.dump()
|
||||
}
|
Loading…
Reference in New Issue