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

Method SetExEqual

tools/autotest/cmd/string.go:68–79  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

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) {
69 es.values[key] = value
70 reply, err := redis.String(es.conn.Do("SETEX", key, delta, value))
71 assert.Equal(t, "OK", reply)
72 assert.NoError(t, err)
73 data, err := redis.Bytes(es.conn.Do("GET", key))
74 assert.Equal(t, value, string(data))
75 assert.NoError(t, err)
76 time.Sleep(time.Second * time.Duration(delta))
77 data, err = redis.Bytes(es.conn.Do("GET", key))
78 assert.Equal(t, "", string(data))
79}
80
81//PSetexEqualErr verify that the return value of the set operation is correct
82func (es *ExampleString) PSetexEqual(t *testing.T, key string, value string, delta int) {

Callers 1

StringCaseMethod · 0.80

Calls 2

BytesMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected