searcherside/core/services/password_hash_test.go
Peter Kurfer 9ea9a8f658
Some checks failed
Go build / build (push) Failing after 1m58s
feat: continue basic setup
- setup ent scheme
- add command to create users
- document API
- add helpers to create migrations
- add command to run migrations
- add basic compose file
2024-06-19 21:19:37 +02:00

34 lines
713 B
Go

package services_test
import (
"testing"
"code.icb4dc0.de/prskr/searcherside/core/services"
)
func TestPasswordHash_UnmarshalText(t *testing.T) {
type args struct {
text []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "Basic test",
args: args{
text: []byte("$argon2id$v=19$m=65536,t=3,p=2$RiKQX+VDY9FtotJETFq8WQ$uCWUzPOlKpIinzryBfy31IHjhn5miKvtS5hER5H+1RE"),
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &services.PasswordHash{}
if err := p.UnmarshalText(tt.args.text); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalText() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}