redis操作
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
552 B

  1. package redis
  2. import (
  3. "testing"
  4. )
  5. func Test_Zset(t *testing.T) {
  6. Conn()
  7. ret3, err := ZAdd("zset", 9, 9)
  8. t.Log(ret3)
  9. t.Log(err)
  10. ret3, err = ZCard("zset")
  11. t.Log(ret3)
  12. t.Log(err)
  13. // ret3, err = ZRem("zset", 9)
  14. // t.Log(ret3)
  15. // t.Log(err)
  16. ret3, err = ZCount("zset", 0, 100)
  17. t.Log(ret3)
  18. t.Log(err)
  19. ret3, err = ZIncrBy("zset", 10, 9)
  20. t.Log(ret3)
  21. t.Log(err)
  22. ret3, err = ZRank("zset", 9)
  23. t.Log(ret3)
  24. t.Log(err)
  25. ret3, err = ZRevrank("zset", 9)
  26. t.Log(ret3)
  27. t.Log(err)
  28. ret4, err := ZScore("zset", 9)
  29. t.Log(ret4)
  30. t.Log(err)
  31. }