cache_test.go 324 B

123456789101112131415161718
  1. package cache
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func init() {
  7. Setup([]string{"127.0.0.1:6379"}, "", 0, 100, 10, 1, false)
  8. }
  9. func TestSAdd(t *testing.T) {
  10. res, err := Redis().SAdd("skey1", "0", "1", "2")
  11. fmt.Println("redis sadd: ", res, err)
  12. b, err := Redis().SetNx("key1", 100900)
  13. fmt.Println("redis setnx: ", b, err)
  14. }