(t *testing.T)
| 76 | } |
| 77 | |
| 78 | func TestMemoryCache_overwrite(t *testing.T) { |
| 79 | t.Parallel() |
| 80 | c, err := New(Config{Enabled: true}) |
| 81 | require.NoError(t, err) |
| 82 | |
| 83 | c.Store("q", "first") |
| 84 | c.Store("q", "second") |
| 85 | |
| 86 | got, ok := c.Lookup("q") |
| 87 | assert.True(t, ok) |
| 88 | assert.Equal(t, "second", got) |
| 89 | } |
| 90 | |
| 91 | // TestFileCache_dedupSkipsRedundantWrite verifies that storing the exact |
| 92 | // same (question, response) pair twice is treated as a no-op, so the |