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

Method IncrByEqual

tools/autotest/cmd/string.go:166–179  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

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) {
167 var vi int
168 if v, ok := es.values[key]; ok {
169 vi, _ = strconv.Atoi(v)
170 vi = vi + delta
171 es.values[key] = strconv.Itoa(vi)
172 } else {
173 vi = delta
174 es.values[key] = strconv.Itoa(vi)
175 }
176 reply, err := redis.Int(es.conn.Do("incrby", key, delta))
177 assert.Equal(t, vi, reply)
178 assert.NoError(t, err)
179}
180
181//IncrByFloatEqual verify that the return value of the incr operation is correct
182func (es *ExampleString) IncrByFloatEqual(t *testing.T, key string, delta float64) {

Callers 1

StringCaseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected