TestRedisClient_DECR tests DECR operation
(t *testing.T)
| 152 | |
| 153 | // TestRedisClient_DECR tests DECR operation |
| 154 | func TestRedisClient_DECR(t *testing.T) { |
| 155 | skipIfNoRedis(t) |
| 156 | client := GetDefaultRedisClient("redis://localhost:6379/0") |
| 157 | key := "test_decr_key" |
| 158 | client.Del(key) |
| 159 | val, err := client.DECR(key) |
| 160 | if err != nil { |
| 161 | t.Errorf("DECR failed: %v", err) |
| 162 | } |
| 163 | if val != -1 { |
| 164 | t.Errorf("DECR returned wrong value: got %d, want -1", val) |
| 165 | } |
| 166 | client.Del(key) |
| 167 | } |
| 168 | |
| 169 | // TestRedisClient_Expire tests Expire operation |
| 170 | func TestRedisClient_Expire(t *testing.T) { |
nothing calls this directly
no test coverage detected