mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@ -8,4 +8,14 @@ fn test_crypto_bcrypt() {
|
||||
bcrypt.compare_hash_and_password('password2'.bytes(), hash.bytes()) or {
|
||||
assert err.msg() == 'mismatched hash and password'
|
||||
}
|
||||
|
||||
hash2 := bcrypt.generate_from_password('bb'.bytes(), 10) or { panic(err) }
|
||||
mut hash2_must_mismatch := false
|
||||
|
||||
bcrypt.compare_hash_and_password('bbb'.bytes(), hash2.bytes()) or {
|
||||
hash2_must_mismatch = true
|
||||
assert err.msg() == 'mismatched hash and password'
|
||||
}
|
||||
|
||||
assert hash2_must_mismatch
|
||||
}
|
||||
|
Reference in New Issue
Block a user