Files
softplayer-backend/internal/helpers/hash/hash_test.go
Nikolai Rodionov cfa666e0a2
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Token authorization is ready for MVP
Reviewed-on: #8
2026-05-15 12:53:58 +00:00

22 lines
508 B
Go

package hash_test
import (
"testing"
"gitea.badhouseplants.net/softplayer/softplayer-backend/internal/helpers/hash"
"github.com/stretchr/testify/assert"
)
func TestUnitHashValid(t *testing.T) {
password := "qwertyu9"
hpass, err := hash.HashPassword(password, 10)
assert.NoError(t, err)
assert.NoError(t, hash.CheckPasswordHash(password, hpass))
}
func TestUnitHashInvalid(t *testing.T) {
password := "qwertyu9"
invhash := "qwertyu9"
assert.Error(t, hash.CheckPasswordHash(password, invhash))
}