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

Method PSetexEqual

tools/autotest/cmd/string.go:82–93  ·  view source on GitHub ↗

PSetexEqualErr 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

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) {
83 es.values[key] = value
84 reply, err := redis.String(es.conn.Do("PSETEX", key, delta, value))
85 assert.Equal(t, "OK", reply)
86 assert.NoError(t, err)
87 data, err := redis.Bytes(es.conn.Do("GET", key))
88 assert.Equal(t, value, string(data))
89 assert.NoError(t, err)
90 time.Sleep(time.Millisecond * time.Duration(delta))
91 data, err = redis.Bytes(es.conn.Do("GET", key))
92 assert.Equal(t, "", string(data))
93}
94
95//SetRangeEqualErr verify that the return value of the set operation is correct
96func (es *ExampleString) SetRangeEqual(t *testing.T, key string, value string) {

Callers 1

StringCaseMethod · 0.80

Calls 2

BytesMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected