MCPcopy
hub / github.com/grafana/dskit / TestMemcachedClient_Decrement

Function TestMemcachedClient_Decrement

cache/memcached_client_test.go:247–260  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

245}
246
247func TestMemcachedClient_Decrement(t *testing.T) {
248 client, _, err := setupDefaultMemcachedClient()
249 require.NoError(t, err)
250
251 key := "foo"
252 initialValue := []byte("2")
253
254 client.SetAsync(key, initialValue, 10*time.Second)
255 require.NoError(t, client.wait())
256
257 incrementedValue, err := client.Decrement(context.Background(), key, 1)
258 require.NoError(t, err)
259 require.Equal(t, uint64(1), incrementedValue)
260}
261
262func TestMemcachedClient_Touch(t *testing.T) {
263 client, backend, err := setupDefaultMemcachedClient()

Callers

nothing calls this directly

Calls 5

waitMethod · 0.80
SetAsyncMethod · 0.65
DecrementMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected