Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mojocn committed Mar 30, 2023
1 parent b3fd6d7 commit 9036526
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions captcha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCaptcha_GenerateB64s(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := NewCaptcha(tt.fields.Driver, tt.fields.Store)
gotId, b64s, err := c.Generate()
gotId, b64s,_, err := c.Generate()
if (err != nil) != tt.wantErr {
t.Errorf("Captcha.Generate() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestCaptcha_Generate(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotId, gotB64s, err := tt.c.Generate()
gotId, gotB64s,_, err := tt.c.Generate()
if (err != nil) != tt.wantErr {
t.Errorf("Captcha.Generate() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down
4 changes: 2 additions & 2 deletions driver_language.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package base64Captcha

import (
"fmt"
"image/color"
"log"
"math/rand"

"github.com/golang/freetype/truetype"
Expand All @@ -26,7 +26,7 @@ var langMap = map[string][]int{
func generateRandomRune(size int, code string) string {
lang, ok := langMap[code]
if !ok {
fmt.Sprintf("can not font language of %s", code)
log.Printf("can not font language of %s \n", code)
lang = langMap["latin"]
}
start := lang[0]
Expand Down
2 changes: 1 addition & 1 deletion faq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestHandlerCaptchaGenerate(t *testing.T) {

c := NewCaptcha(driver, s)

id, _, err := c.Generate()
id, _,_, err := c.Generate()
if err != nil {
t.Fatalf("some error: %s", err)
}
Expand Down

0 comments on commit 9036526

Please sign in to comment.