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

Method IncrEqual

tools/autotest/cmd/string.go:134–147  ·  view source on GitHub ↗

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

(t *testing.T, key string)

Source from the content-addressed store, hash-verified

132
133//IncrEqual verify that the return value of the incr operation is correct
134func (es *ExampleString) IncrEqual(t *testing.T, key string) {
135 var vi int
136 if v, ok := es.values[key]; ok {
137 vi, _ = strconv.Atoi(v)
138 vi = vi + 1
139 es.values[key] = strconv.Itoa(vi)
140 } else {
141 vi = 1
142 es.values[key] = strconv.Itoa(vi)
143 }
144 reply, err := redis.Int(es.conn.Do("incr", key))
145 assert.Equal(t, vi, reply)
146 assert.NoError(t, err)
147}
148
149//DecrEqual verify that the return value of the incr operation is correct
150func (es *ExampleString) DecrEqual(t *testing.T, key string) {

Callers 1

StringCaseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected