SetExEqualErr verify that the return value of the set operation is correct
(t *testing.T, key string, value string, delta int)
| 66 | |
| 67 | //SetExEqualErr verify that the return value of the set operation is correct |
| 68 | func (es *ExampleString) SetExEqual(t *testing.T, key string, value string, delta int) { |
| 69 | es.values[key] = value |
| 70 | reply, err := redis.String(es.conn.Do("SETEX", key, delta, value)) |
| 71 | assert.Equal(t, "OK", reply) |
| 72 | assert.NoError(t, err) |
| 73 | data, err := redis.Bytes(es.conn.Do("GET", key)) |
| 74 | assert.Equal(t, value, string(data)) |
| 75 | assert.NoError(t, err) |
| 76 | time.Sleep(time.Second * time.Duration(delta)) |
| 77 | data, err = redis.Bytes(es.conn.Do("GET", key)) |
| 78 | assert.Equal(t, "", string(data)) |
| 79 | } |
| 80 | |
| 81 | //PSetexEqualErr verify that the return value of the set operation is correct |
| 82 | func (es *ExampleString) PSetexEqual(t *testing.T, key string, value string, delta int) { |
no test coverage detected