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 {
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func TestStringAndFilterString(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func TestGitHubReleaseChecker_checkNewVersion(t *testing.T) {
|
||||
t.Parallel()
|
||||
type fields struct {
|
||||
Repo string
|
||||
}
|
||||
|
@ -112,6 +113,7 @@ func TestGitHubReleaseChecker_checkNewVersion(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_isDevelop(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
version string
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
// A '*' in a provided string will not result in matching the strings before and after the '*' of the string provided.
|
||||
// Sample usage: In resource matching for bucket policy validation.
|
||||
func TestMatch(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
pattern string
|
||||
text string
|
||||
|
@ -151,6 +152,7 @@ func TestMatch(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMatchSimple(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
pattern string
|
||||
name string
|
||||
|
@ -183,6 +185,7 @@ func TestMatchSimple(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMatchSliceSimple(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
patterns []string
|
||||
name string
|
||||
|
@ -209,6 +212,7 @@ func TestMatchSliceSimple(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMatchSlice(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
patterns []string
|
||||
name string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue