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

Function TestMemcachedClient_Increment

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

Source from the content-addressed store, hash-verified

230}
231
232func TestMemcachedClient_Increment(t *testing.T) {
233 client, _, err := setupDefaultMemcachedClient()
234 require.NoError(t, err)
235
236 key := "foo"
237 initialValue := []byte("2")
238
239 client.SetAsync(key, initialValue, 10*time.Second)
240 require.NoError(t, client.wait())
241
242 incrementedValue, err := client.Increment(context.Background(), key, 1)
243 require.NoError(t, err)
244 require.Equal(t, uint64(3), incrementedValue)
245}
246
247func TestMemcachedClient_Decrement(t *testing.T) {
248 client, _, err := setupDefaultMemcachedClient()

Callers

nothing calls this directly

Calls 5

waitMethod · 0.80
SetAsyncMethod · 0.65
IncrementMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected