mirror of
https://github.com/pushbits/server.git
synced 2025-05-28 16:26:37 +02:00
Restructure project layout
This commit is contained in:
parent
a49db216d5
commit
9a4a096526
32 changed files with 35 additions and 35 deletions
23
internal/authentication/credentials/hibp_test.go
Normal file
23
internal/authentication/credentials/hibp_test.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package credentials
|
||||
|
||||
import "testing"
|
||||
|
||||
type isPasswordPwnedTest struct {
|
||||
arg string
|
||||
exp1 bool
|
||||
exp2 error
|
||||
}
|
||||
|
||||
var isPasswordPwnedTests = []isPasswordPwnedTest{
|
||||
{"", true, nil},
|
||||
{"password", true, nil},
|
||||
{"2y6bWMETuHpNP08HCZq00QAAzE6nmwEb", false, nil},
|
||||
}
|
||||
|
||||
func TestIsPasswordPwned(t *testing.T) {
|
||||
for _, test := range isPasswordPwnedTests {
|
||||
if out1, out2 := IsPasswordPwned(test.arg); out1 != test.exp1 || out2 != test.exp2 {
|
||||
t.Errorf("Output (%t,%q) not equal to expected (%t,%q)", out1, out2, test.exp1, test.exp2)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue