All checks were successful
ci/woodpecker/push/build Pipeline was successful
Reviewed-on: #8
22 lines
508 B
Go
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))
|
|
}
|