MCPcopy Create free account
hub / github.com/devfeel/dotweb / TestRedisClient_DECR

Function TestRedisClient_DECR

framework/redis/redisutil_test.go:154–167  ·  view source on GitHub ↗

TestRedisClient_DECR tests DECR operation

(t *testing.T)

Source from the content-addressed store, hash-verified

152
153// TestRedisClient_DECR tests DECR operation
154func 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
170func TestRedisClient_Expire(t *testing.T) {

Callers

nothing calls this directly

Calls 4

skipIfNoRedisFunction · 0.85
GetDefaultRedisClientFunction · 0.85
DelMethod · 0.80
DECRMethod · 0.80

Tested by

no test coverage detected