hash test
This commit is contained in:
@@ -7,4 +7,10 @@ run: build
|
||||
clean:
|
||||
@docker builder prune
|
||||
|
||||
test:
|
||||
@go test ./api/src/auth/... -v
|
||||
|
||||
tc:
|
||||
@go test -cover
|
||||
|
||||
.DEFAULT_GOAL=run
|
||||
@@ -0,0 +1,7 @@
|
||||
t:
|
||||
@go test ./... -v
|
||||
|
||||
tc:
|
||||
go
|
||||
|
||||
@DEFAULT_GOAL=t
|
||||
@@ -0,0 +1,16 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
func Test_hashPass(t *testing.T) {
|
||||
password := "some hard password"
|
||||
hash, _ := hashPassword(password)
|
||||
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
|
||||
if err != nil {
|
||||
t.Errorf("Falis by: %s", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user