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

Method DecrEqual

tools/autotest/cmd/string.go:150–163  ·  view source on GitHub ↗

DecrEqual verify that the return value of the incr operation is correct

(t *testing.T, key string)

Source from the content-addressed store, hash-verified

148
149//DecrEqual verify that the return value of the incr operation is correct
150func (es *ExampleString) DecrEqual(t *testing.T, key string) {
151 var vi int
152 if v, ok := es.values[key]; ok {
153 vi, _ = strconv.Atoi(v)
154 vi = vi - 1
155 es.values[key] = strconv.Itoa(vi)
156 } else {
157 vi = -1
158 es.values[key] = strconv.Itoa(vi)
159 }
160 reply, err := redis.Int(es.conn.Do("decr", key))
161 assert.Equal(t, vi, reply)
162 assert.NoError(t, err)
163}
164
165//IncrByEqual verify that the return value of the incr operation is correct
166func (es *ExampleString) IncrByEqual(t *testing.T, key string, delta int) {

Callers 1

StringCaseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected