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.
28 lines
489 B
28 lines
489 B
2 years ago
|
package base64Captcha
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestHandlerCaptchaGenerate(t *testing.T) {
|
||
|
s := DefaultMemStore
|
||
|
|
||
|
driver := &DriverString{
|
||
|
Height: 80,
|
||
|
Width: 240,
|
||
|
NoiseCount: 10,
|
||
|
ShowLineOptions: 10,
|
||
|
Length: 10,
|
||
|
Source: "axclajsdlfkjalskjdglasdg",
|
||
|
BgColor: nil,
|
||
|
Fonts: nil,
|
||
|
}
|
||
|
|
||
|
c := NewCaptcha(driver, s)
|
||
|
|
||
|
id, _, err := c.Generate()
|
||
|
if err != nil {
|
||
|
t.Fatalf("some error: %s", err)
|
||
|
}
|
||
|
|
||
|
t.Logf("id: %s", id)
|
||
|
}
|