tests: add sample pin/hash pair from migration dataset

This commit is contained in:
Mohamed Sohail 2025-01-03 11:10:07 +03:00
parent 0fe48a30fa
commit 91dc9ce82f
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -99,6 +99,27 @@ func TestHashPIN(t *testing.T) {
}
}
func TestVerifyMigratedHashPin(t *testing.T) {
tests := []struct {
pin string
hash string
}{
{
pin: "1234",
hash: "$2b$08$dTvIGxCCysJtdvrSnaLStuylPoOS/ZLYYkxvTeR5QmTFY3TSvPQC6",
},
}
for _, tt := range tests {
t.Run(tt.pin, func(t *testing.T) {
ok := VerifyPIN(tt.hash, tt.pin)
if !ok {
t.Errorf("VerifyPIN could not verify migrated PIN: %v", tt.pin, ok)
}
})
}
}
func TestVerifyPIN(t *testing.T) {
tests := []struct {
name string