diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-27 00:02:29 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-29 02:14:51 -0700 |
commit | bdfb423cbaff683269c7448afe6d93d224c5a482 (patch) | |
tree | 2f10c3a13f56f94e498b8e3aac3e519a91d86518 /compat/json/borrowed_stream_test.go | |
parent | 659b2cd182132b0827484855689e3d21e8d9ce9f (diff) |
.golangci.yml: Turn on 'paralleltest', fix
Diffstat (limited to 'compat/json/borrowed_stream_test.go')
-rw-r--r-- | compat/json/borrowed_stream_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compat/json/borrowed_stream_test.go b/compat/json/borrowed_stream_test.go index 80f6f03..6c3a403 100644 --- a/compat/json/borrowed_stream_test.go +++ b/compat/json/borrowed_stream_test.go @@ -41,6 +41,7 @@ false ` func TestEncoder(t *testing.T) { + t.Parallel() // MODIFIED: added for i := 0; i <= len(streamTest); i++ { var buf bytes.Buffer enc := NewEncoder(&buf) @@ -78,6 +79,7 @@ false ` func TestEncoderIndent(t *testing.T) { + t.Parallel() // MODIFIED: added var buf bytes.Buffer enc := NewEncoder(&buf) enc.SetIndent(">", ".") @@ -105,6 +107,7 @@ func (s *strPtrMarshaler) MarshalJSON() ([]byte, error) { } func TestEncoderSetEscapeHTML(t *testing.T) { + t.Parallel() // MODIFIED: added var c C var ct CText var tagStruct struct { @@ -173,6 +176,7 @@ func TestEncoderSetEscapeHTML(t *testing.T) { } func TestDecoder(t *testing.T) { + t.Parallel() // MODIFIED: added for i := 0; i <= len(streamTest); i++ { // Use stream without newlines as input, // just to stress the decoder even more. @@ -205,6 +209,7 @@ func TestDecoder(t *testing.T) { } func TestDecoderBuffered(t *testing.T) { + t.Parallel() // MODIFIED: added r := strings.NewReader(`{"Name": "Gopher"} extra `) var m struct { Name string @@ -241,6 +246,7 @@ func nlines(s string, n int) string { } func TestRawMessage(t *testing.T) { + t.Parallel() // MODIFIED: added var data struct { X float64 Id RawMessage @@ -265,6 +271,7 @@ func TestRawMessage(t *testing.T) { } func TestNullRawMessage(t *testing.T) { + t.Parallel() // MODIFIED: added var data struct { X float64 Id RawMessage @@ -297,6 +304,7 @@ var blockingTests = []string{ } func TestBlocking(t *testing.T) { + t.Parallel() // MODIFIED: added for _, enc := range blockingTests { r, w := net.Pipe() ch := make(chan error) // MODIFIED: added @@ -451,6 +459,7 @@ func TestDecodeInStream(t *testing.T) { // Test from golang.org/issue/11893 func TestHTTPDecoding(t *testing.T) { + t.Parallel() // MODIFIED: added const raw = `{ "foo": "bar" }` ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |