(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestMemcachedClient_FlushAll(t *testing.T) { |
| 301 | client, _, err := setupDefaultMemcachedClient() |
| 302 | require.NoError(t, err) |
| 303 | |
| 304 | keys := []string{"foo", "bar"} |
| 305 | expiration := 10 * time.Second |
| 306 | |
| 307 | client.SetMultiAsync(map[string][]byte{"foo": []byte("bar"), "bar": []byte("baz")}, expiration) |
| 308 | require.NoError(t, client.wait()) |
| 309 | |
| 310 | // Verify that the data is initially present |
| 311 | tmpRes := client.GetMulti(context.Background(), keys) |
| 312 | require.NotEmpty(t, tmpRes) |
| 313 | |
| 314 | // FlushAll operation |
| 315 | err = client.FlushAll(context.Background()) |
| 316 | require.NoError(t, err) |
| 317 | |
| 318 | // Verify that the cash is empty after FlushAll |
| 319 | res := client.GetMulti(context.Background(), keys) |
| 320 | require.Empty(t, res) |
| 321 | } |
| 322 | |
| 323 | func TestMemcachedClient_Delete(t *testing.T) { |
| 324 | client, _, err := setupDefaultMemcachedClient() |
nothing calls this directly
no test coverage detected