(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestMemoryCache_trimSpaces(t *testing.T) { |
| 52 | t.Parallel() |
| 53 | c, err := New(Config{Enabled: true, TrimSpaces: true}) |
| 54 | require.NoError(t, err) |
| 55 | |
| 56 | c.Store(" hello ", "world") |
| 57 | |
| 58 | got, ok := c.Lookup("hello") |
| 59 | assert.True(t, ok) |
| 60 | assert.Equal(t, "world", got) |
| 61 | |
| 62 | got, ok = c.Lookup("\thello\n") |
| 63 | assert.True(t, ok) |
| 64 | assert.Equal(t, "world", got) |
| 65 | } |
| 66 | |
| 67 | func TestMemoryCache_noTrimByDefault(t *testing.T) { |
| 68 | t.Parallel() |