package captcha import ( "git.bvbej.com/bvbej/base-golang/pkg/cache" "testing" "time" ) func TestNewCaptcha(t *testing.T) { repo, err := cache.New("127.0.0.1:6379", "", 0, 5, 100, 10) if err != nil { t.Error(err) return } newStore := NewStore(repo, 5*time.Minute) newCaptcha := NewCaptcha(newStore, 80, 180, 5) generate, s, err := newCaptcha.Generate() if err != nil { t.Error(err) return } t.Log(generate, s) }