Peter Kurfer
9ea9a8f658
Some checks failed
Go build / build (push) Failing after 1m58s
- setup ent scheme - add command to create users - document API - add helpers to create migrations - add command to run migrations - add basic compose file
34 lines
713 B
Go
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)
|
|
}
|
|
})
|
|
}
|
|
}
|