aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/goccy/go-json/size_test.go
blob: 00c3a2b705af2ead8bd31269fe13540e3f16f5df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package json

import (
	"testing"
	"unsafe"

	"github.com/goccy/go-json/internal/encoder"
)

func TestOpcodeSize(t *testing.T) {
	const uintptrSize = 4 << (^uintptr(0) >> 63)
	if uintptrSize == 8 {
		size := unsafe.Sizeof(encoder.Opcode{})
		if size != 120 {
			t.Fatalf("unexpected opcode size: expected 112bytes but got %dbytes", size)
		}
	}
}