(t *testing.T, cache *BufferCache, key string)
| 76 | } |
| 77 | |
| 78 | func assertKeyInHotCache(t *testing.T, cache *BufferCache, key string) { |
| 79 | t.Helper() |
| 80 | |
| 81 | loc, ok := cache.m.m[key] |
| 82 | if !ok { |
| 83 | t.Fatalf(`key "%s" not found in location map`, key) |
| 84 | } |
| 85 | if !loc.isHot() { |
| 86 | t.Errorf("not in hot cache: got loc=%v", loc) |
| 87 | } |
| 88 | if _, ok := cache.hot.m[key]; !ok { |
| 89 | t.Errorf(`key "%s" not found in hot cache`, key) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func assertKeyNotInHotCache(t *testing.T, cache *BufferCache, key string) { |
| 94 | t.Helper() |
no test coverage detected