IncrEqual verify that the return value of the incr operation is correct
(t *testing.T, key string)
| 132 | |
| 133 | //IncrEqual verify that the return value of the incr operation is correct |
| 134 | func (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 |
| 150 | func (es *ExampleString) DecrEqual(t *testing.T, key string) { |