DriveLinked/pkg/common/token_test.go

29 lines
409 B
Go
Raw Normal View History

2022-04-03 12:30:50 +08:00
package common
import (
"drive-linked/config"
"testing"
)
func TestNewToken(t *testing.T) {
config.SetupConfig()
token, err := NewToken("eigeen")
if err != nil {
t.Error(err)
}
t.Log(token)
}
2022-04-05 18:16:20 +08:00
func TestValidateLogin(t *testing.T) {
config.SetupConfig()
tokenString, _ := NewToken("eigeen")
err := VerifyToken(tokenString)
2022-04-05 18:16:20 +08:00
if err == nil {
t.Log("验证通过")
} else {
t.Error(err)
}
}