(t *testing.T)
| 166 | } |
| 167 | |
| 168 | func TestFileCache_corruptFile(t *testing.T) { |
| 169 | t.Parallel() |
| 170 | dir := t.TempDir() |
| 171 | path := filepath.Join(dir, "cache.json") |
| 172 | require.NoError(t, os.WriteFile(path, []byte("not json"), 0o600)) |
| 173 | |
| 174 | _, err := New(Config{Enabled: true, Path: path}) |
| 175 | assert.Error(t, err) |
| 176 | } |
| 177 | |
| 178 | // TestFileCache_persistenceFailureKeepsInMemory verifies that a Store |
| 179 | // whose underlying file write fails still updates the in-memory map: a |