DecrbyEqual verify that the return value of the incr operation is correct
(t *testing.T, key string, delta int)
| 196 | |
| 197 | //DecrbyEqual verify that the return value of the incr operation is correct |
| 198 | func (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 |
| 214 | func (es *ExampleString) IncrEqualErr(t *testing.T, errValue string, args ...interface{}) { |