Files
full/module/ec/mall/internal/password/password_test.go

14 lines
283 B
Go

package password
import "testing"
func TestHashAndVerify(t *testing.T) {
hash, err := Hash("correct horse battery staple")
if err != nil {
t.Fatal(err)
}
if !Verify(hash, "correct horse battery staple") || Verify(hash, "wrong") {
t.Fatal("bcrypt verification failed")
}
}