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

Method DecrByEqual

tools/autotest/cmd/string.go:198–211  ·  view source on GitHub ↗

DecrbyEqual 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

196
197//DecrbyEqual verify that the return value of the incr operation is correct
198func (es *ExampleString) DecrByEqual(t *testing.T, key string, delta int) {
199 var vi int
200 if v, ok := es.values[key]; ok {
201 vi, _ = strconv.Atoi(v)
202 vi = vi - delta
203 es.values[key] = strconv.Itoa(vi)
204 } else {
205 vi = -delta
206 es.values[key] = strconv.Itoa(vi)
207 }
208 reply, err := redis.Int(es.conn.Do("decrby", key, delta))
209 assert.Equal(t, vi, reply)
210 assert.NoError(t, err)
211}
212
213//IncrEqualErr verify that the return value of the incr operation is correct
214func (es *ExampleString) IncrEqualErr(t *testing.T, errValue string, args ...interface{}) {

Callers 1

StringCaseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected