DecrEqual verify that the return value of the incr operation is correct
(t *testing.T, key string)
| 148 | |
| 149 | //DecrEqual verify that the return value of the incr operation is correct |
| 150 | func (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 |
| 166 | func (es *ExampleString) IncrByEqual(t *testing.T, key string, delta int) { |