diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2019-10-16 01:59:56 +0200 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2019-10-16 10:20:13 +0200 |
commit | c3d82ca3a430260ff1795abfeac9e8396ed6f6fe (patch) | |
tree | dde63ec5b5f22388ef65a12ca7dc6bc131bee2d8 /bytesconv_test.go | |
parent | Use Fatal instead of Fatalf when no formatting used (diff) | |
download | fasthttp-c3d82ca3a430260ff1795abfeac9e8396ed6f6fe.tar.gz fasthttp-c3d82ca3a430260ff1795abfeac9e8396ed6f6fe.tar.bz2 fasthttp-c3d82ca3a430260ff1795abfeac9e8396ed6f6fe.zip |
Speed up testing by running tests in parallel
Diffstat (limited to 'bytesconv_test.go')
-rw-r--r-- | bytesconv_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bytesconv_test.go b/bytesconv_test.go index c160b6b..7ff0e2e 100644 --- a/bytesconv_test.go +++ b/bytesconv_test.go @@ -12,6 +12,8 @@ import ( ) func TestAppendHTMLEscape(t *testing.T) { + t.Parallel() + testAppendHTMLEscape(t, "", "") testAppendHTMLEscape(t, "<", "<") testAppendHTMLEscape(t, "a", "a") @@ -27,6 +29,8 @@ func testAppendHTMLEscape(t *testing.T, s, expectedS string) { } func TestParseIPv4(t *testing.T) { + t.Parallel() + testParseIPv4(t, "0.0.0.0", true) testParseIPv4(t, "255.255.255.255", true) testParseIPv4(t, "123.45.67.89", true) @@ -58,6 +62,8 @@ func testParseIPv4(t *testing.T, ipStr string, isValid bool) { } func TestAppendIPv4(t *testing.T) { + t.Parallel() + testAppendIPv4(t, "0.0.0.0", true) testAppendIPv4(t, "127.0.0.1", true) testAppendIPv4(t, "8.8.8.8", true) @@ -109,6 +115,8 @@ func testWriteHexInt(t *testing.T, n int, expectedS string) { } func TestReadHexIntError(t *testing.T) { + t.Parallel() + testReadHexIntError(t, "") testReadHexIntError(t, "ZZZ") testReadHexIntError(t, "-123") @@ -140,6 +148,8 @@ func testReadHexIntSuccess(t *testing.T, s string, expectedN int) { } func TestAppendHTTPDate(t *testing.T) { + t.Parallel() + d := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) s := string(AppendHTTPDate(nil, d)) expectedS := "Tue, 10 Nov 2009 23:00:00 GMT" @@ -159,6 +169,8 @@ func TestAppendHTTPDate(t *testing.T) { } func TestParseUintError(t *testing.T) { + t.Parallel() + // empty string testParseUintError(t, "") @@ -180,6 +192,8 @@ func TestParseUintError(t *testing.T) { } func TestParseUfloatSuccess(t *testing.T) { + t.Parallel() + testParseUfloatSuccess(t, "0", 0) testParseUfloatSuccess(t, "1.", 1.) testParseUfloatSuccess(t, ".1", 0.1) @@ -191,6 +205,8 @@ func TestParseUfloatSuccess(t *testing.T) { } func TestParseUfloatError(t *testing.T) { + t.Parallel() + // empty num testParseUfloatError(t, "") @@ -262,6 +278,8 @@ func testParseUintSuccess(t *testing.T, s string, expectedN int) { } func TestAppendUnquotedArg(t *testing.T) { + t.Parallel() + testAppendUnquotedArg(t, "", "") testAppendUnquotedArg(t, "abc", "abc") testAppendUnquotedArg(t, "тест.abc", "тест.abc") |