1 package tracker 2 3 import ( 4 "testing" 5 "unsafe" 6 7 "github.com/stretchr/testify/require" 8 ) 9 10 func TestEntrySize(t *testing.T) { 11 // Validate no regression on the size of entry{}. This is a critical bit for 12 // performance of unmarshaling documents. Should only be increased with care 13 // and a very good reason. 14 maxExpectedEntrySize := 48 15 require.LessOrEqual(t, int(unsafe.Sizeof(entry{})), maxExpectedEntrySize) 16 } 17