start_test.go 533 B

12345678910111213141516171819202122232425262728
  1. package gocaptcha
  2. import (
  3. "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
  4. "app.yhyue.com/moapp/jybase/redis"
  5. "fmt"
  6. "net/http"
  7. "testing"
  8. "time"
  9. )
  10. func TestCaptcha(t *testing.T) {
  11. redis.InitRedisBySize("other=172.20.45.129:1712", 100, 30, 300)
  12. InitCaptcha()
  13. var (
  14. W http.ResponseWriter
  15. R *http.Request
  16. Session = &httpsession.Session{}
  17. )
  18. Session.SetId("001")
  19. Get(Session, "--", W, R)
  20. time.Sleep(10 * time.Second)
  21. }
  22. func TestVerify(t *testing.T) {
  23. b := VerifyString("JHPC", "JHPC")
  24. fmt.Println(b)
  25. }