MCPcopy Create free account
hub / github.com/distributedio/titan / SetNxEqual

Method SetNxEqual

tools/autotest/cmd/string.go:57–65  ·  view source on GitHub ↗

SetNxEqualErr verify that the return value of the set operation is correct

(t *testing.T, key string, value string)

Source from the content-addressed store, hash-verified

55
56//SetNxEqualErr verify that the return value of the set operation is correct
57func (es *ExampleString) SetNxEqual(t *testing.T, key string, value string) {
58 es.values[key] = value
59 reply, err := redis.Int(es.conn.Do("SETNX", key, value))
60 assert.Equal(t, 1, reply)
61 assert.NoError(t, err)
62 data, err := redis.Bytes(es.conn.Do("GET", key))
63 assert.Equal(t, value, string(data))
64 assert.NoError(t, err)
65}
66
67//SetExEqualErr verify that the return value of the set operation is correct
68func (es *ExampleString) SetExEqual(t *testing.T, key string, value string, delta int) {

Callers 1

StringCaseMethod · 0.80

Calls 1

BytesMethod · 0.80

Tested by

no test coverage detected