MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / TestHintEntrySize

Function TestHintEntrySize

hintfile_test.go:77–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestHintEntrySize(t *testing.T) {
78 entry := &HintEntry{
79 BucketId: 1,
80 KeySize: 3,
81 ValueSize: 5,
82 Timestamp: 1234567890,
83 TTL: 3600,
84 Flag: DataSetFlag,
85 Status: Committed,
86 Ds: DataStructureBTree,
87 DataPos: 100,
88 FileID: 1,
89 Key: []byte("key"),
90 }
91
92 expectedSize := entry.Size()
93 encoded := entry.Encode()
94 actualSize := int64(len(encoded))
95
96 if expectedSize != actualSize {
97 t.Errorf("Expected size %d, got %d", expectedSize, actualSize)
98 }
99}
100
101func TestHintEntryEncodeDecodeEdgeCases(t *testing.T) {
102 testCases := []struct {

Callers

nothing calls this directly

Calls 2

SizeMethod · 0.95
EncodeMethod · 0.95

Tested by

no test coverage detected