-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load all fonts if there is not set any
- Loading branch information
EricZhou
committed
Apr 12, 2021
1 parent
4009b92
commit 5dfa8d3
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters