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

Function createTestRecord

internal/data/btree_test.go:219–225  ·  view source on GitHub ↗

createTestRecord creates a record with the given key, TTL, and timestamp

(key string, ttlVal uint32, timestamp uint64)

Source from the content-addressed store, hash-verified

217
218// createTestRecord creates a record with the given key, TTL, and timestamp
219func createTestRecord(key string, ttlVal uint32, timestamp uint64) *core.Record {
220 return core.NewRecord().
221 WithKey([]byte(key)).
222 WithValue([]byte("value_" + key)).
223 WithTTL(ttlVal).
224 WithTimestamp(timestamp)
225}
226
227func TestBTree_TTL_Find(t *testing.T) {
228 mockClock := ttl.NewMockClock(1000000) // Current time: 1000 seconds in millis

Callers 11

TestBTree_TTL_FindFunction · 0.85
TestBTree_TTL_AllFunction · 0.85
TestBTree_TTL_RangeFunction · 0.85
TestBTree_TTL_PrefixScanFunction · 0.85
TestBTree_TTL_MinMaxFunction · 0.85
TestBTree_TTL_PopMinMaxFunction · 0.85
TestBTree_TTL_AllItemsFunction · 0.85
TestBTree_GetTTLFunction · 0.85
TestBTree_IsExpiredKeyFunction · 0.85

Calls 5

NewRecordFunction · 0.92
WithTimestampMethod · 0.80
WithTTLMethod · 0.45
WithValueMethod · 0.45
WithKeyMethod · 0.45

Tested by

no test coverage detected