(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestSKeyExists(t *testing.T) { |
| 301 | db := getTestConn() |
| 302 | ctx := context.Background() |
| 303 | key := "skeyexists_test" |
| 304 | if n, err := db.Do(ctx, "SKeyExists", key).Result(); err != nil { |
| 305 | t.Fatal(err.Error()) |
| 306 | } else if n, ok := n.(int64); !ok || n != 0 { |
| 307 | t.Fatal("invalid value ", n) |
| 308 | } |
| 309 | |
| 310 | db.SAdd(ctx, key, "hello", "world") |
| 311 | |
| 312 | if n, err := db.Do(ctx, "SKeyExists", key).Result(); err != nil { |
| 313 | t.Fatal(err.Error()) |
| 314 | } else if n, ok := n.(int64); !ok || n != 1 { |
| 315 | t.Fatal("invalid value ", n) |
| 316 | } |
| 317 | } |
nothing calls this directly
no test coverage detected