mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(tests): add Parallelization where possible (#1823)
* feat(tests): add Parallelization where possible
This commit is contained in:
parent
c0882aff84
commit
4cc0f9cc83
18 changed files with 53 additions and 2 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func TestCreateHash(t *testing.T) {
|
||||
t.Parallel()
|
||||
hashRX, err := regexp.Compile(`^\$argon2id\$v=19\$m=65536,t=1,p=2\$[A-Za-z0-9+/]{22}\$[A-Za-z0-9+/]{43}$`)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -35,6 +36,7 @@ func TestCreateHash(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestComparePasswordAndHash(t *testing.T) {
|
||||
t.Parallel()
|
||||
hash, err := CreateHash("pa$$word", DefaultParams)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -60,6 +62,7 @@ func TestComparePasswordAndHash(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDecodeHash(t *testing.T) {
|
||||
t.Parallel()
|
||||
hash, err := CreateHash("pa$$word", DefaultParams)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -75,6 +78,7 @@ func TestDecodeHash(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCheckHash(t *testing.T) {
|
||||
t.Parallel()
|
||||
hash, err := CreateHash("pa$$word", DefaultParams)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -93,6 +97,7 @@ func TestCheckHash(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestStrictDecoding(t *testing.T) {
|
||||
t.Parallel()
|
||||
// "bug" valid hash: $argon2id$v=19$m=65536,t=1,p=2$UDk0zEuIzbt0x3bwkf8Bgw$ihSfHWUJpTgDvNWiojrgcN4E0pJdUVmqCEdRZesx9tE
|
||||
ok, _, err := CheckHash("bug", "$argon2id$v=19$m=65536,t=1,p=2$UDk0zEuIzbt0x3bwkf8Bgw$ihSfHWUJpTgDvNWiojrgcN4E0pJdUVmqCEdRZesx9tE")
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue