添加测试文件

This commit is contained in:
yun
2025-11-09 18:23:08 +08:00
parent 7bbd570de9
commit 034315ddbd
5 changed files with 93 additions and 10 deletions
+20
View File
@@ -0,0 +1,20 @@
package bcryptx_test
import (
"testing"
"code.yun.ink/pkg/encryptx/bcryptx"
)
func TestDecryptBcrypt(t *testing.T) {
str, err := bcryptx.HashPassword("password")
if err != nil {
t.Error(err)
}
t.Log(str)
if bcryptx.CheckPasswordHash("password", str) {
t.Log("ok")
} else {
t.Error("error")
}
}