1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

test: add parallel running for all unit test functions

This commit is contained in:
dudaodong
2023-06-30 10:18:45 +08:00
parent ab364744b6
commit 8229de2f10
15 changed files with 480 additions and 16 deletions

View File

@@ -9,6 +9,8 @@ import (
)
func TestRandString(t *testing.T) {
t.Parallel()
pattern := `^[a-zA-Z]+$`
reg := regexp.MustCompile(pattern)
@@ -20,6 +22,8 @@ func TestRandString(t *testing.T) {
}
func TestRandUpper(t *testing.T) {
t.Parallel()
pattern := `^[A-Z]+$`
reg := regexp.MustCompile(pattern)
@@ -31,6 +35,8 @@ func TestRandUpper(t *testing.T) {
}
func TestRandLower(t *testing.T) {
t.Parallel()
pattern := `^[a-z]+$`
reg := regexp.MustCompile(pattern)
@@ -42,6 +48,8 @@ func TestRandLower(t *testing.T) {
}
func TestRandNumeral(t *testing.T) {
t.Parallel()
pattern := `^[0-9]+$`
reg := regexp.MustCompile(pattern)
@@ -53,6 +61,8 @@ func TestRandNumeral(t *testing.T) {
}
func TestRandNumeralOrLetter(t *testing.T) {
t.Parallel()
pattern := `^[0-9a-zA-Z]+$`
reg := regexp.MustCompile(pattern)
@@ -64,6 +74,8 @@ func TestRandNumeralOrLetter(t *testing.T) {
}
func TestRandInt(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestRandInt")
r1 := RandInt(1, 10)
@@ -79,6 +91,8 @@ func TestRandInt(t *testing.T) {
}
func TestRandBytes(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestRandBytes")
randBytes := RandBytes(4)
@@ -93,6 +107,8 @@ func TestRandBytes(t *testing.T) {
}
func TestUUIdV4(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestUUIdV4")
uuid, err := UUIdV4()
@@ -105,6 +121,8 @@ func TestUUIdV4(t *testing.T) {
}
func TestRandUniqueIntSlice(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestRandUniqueIntSlice")
r1 := RandUniqueIntSlice(5, 0, 9)