(t *testing.T)
| 288 | } |
| 289 | |
| 290 | func TestTable_ComposeFieldKey(t *testing.T) { |
| 291 | var a = assert.NewAssertion(t) |
| 292 | |
| 293 | var table = testOpenStoreTable[*testCachedItem](t, "cache_items", &testCacheItemEncoder[*testCachedItem]{}) |
| 294 | |
| 295 | defer func() { |
| 296 | _ = testingStore.Close() |
| 297 | }() |
| 298 | |
| 299 | var fieldKeyBytes = table.ComposeFieldKey([]byte("Lily"), "username", []byte("lucy")) |
| 300 | t.Log(string(fieldKeyBytes)) |
| 301 | fieldValueBytes, keyValueBytes, err := table.DecodeFieldKey("username", fieldKeyBytes) |
| 302 | if err != nil { |
| 303 | t.Fatal(err) |
| 304 | } |
| 305 | t.Log("field:", string(fieldValueBytes), "key:", string(keyValueBytes)) |
| 306 | a.IsTrue(string(fieldValueBytes) == "lucy") |
| 307 | a.IsTrue(string(keyValueBytes) == "Lily") |
| 308 | } |
| 309 | |
| 310 | func BenchmarkTable_Set(b *testing.B) { |
| 311 | runtime.GOMAXPROCS(4) |
nothing calls this directly
no test coverage detected