fix: address code review findings
This commit is contained in:
9
internal/cache/store_test.go
vendored
9
internal/cache/store_test.go
vendored
@@ -72,10 +72,17 @@ func TestCacheKeyString(t *testing.T) {
|
||||
|
||||
// Search key
|
||||
searchKey := &CacheKey{Kind: "search", From: "c146", To: "c213", Date: "2026-08-15"}
|
||||
expectedSearchKey := "search:c146:c213:2026-08-15"
|
||||
expectedSearchKey := "search:c146:c213:2026-08-15:near"
|
||||
if keyString(searchKey) != expectedSearchKey {
|
||||
t.Errorf("expected %s, got %s", expectedSearchKey, keyString(searchKey))
|
||||
}
|
||||
|
||||
// Search key with far-term flag
|
||||
searchKeyFarTerm := &CacheKey{Kind: "search", From: "c146", To: "c213", Date: "2026-08-30", Request: "far"}
|
||||
expectedSearchKeyFarTerm := "search:c146:c213:2026-08-30:far"
|
||||
if keyString(searchKeyFarTerm) != expectedSearchKeyFarTerm {
|
||||
t.Errorf("expected %s, got %s", expectedSearchKeyFarTerm, keyString(searchKeyFarTerm))
|
||||
}
|
||||
}
|
||||
|
||||
// TestCacheAsideGetOrSet tests the cache-aside GetOrSetFuncPattern.
|
||||
|
||||
Reference in New Issue
Block a user