diff options
Diffstat (limited to 'compat/json/borrowed_stream_test.go')
-rw-r--r-- | compat/json/borrowed_stream_test.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compat/json/borrowed_stream_test.go b/compat/json/borrowed_stream_test.go index 1ffb43d..6c3a403 100644 --- a/compat/json/borrowed_stream_test.go +++ b/compat/json/borrowed_stream_test.go @@ -9,7 +9,6 @@ package json import ( "bytes" "io" - "log" "net" "net/http" "net/http/httptest" @@ -42,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) @@ -79,6 +79,7 @@ false ` func TestEncoderIndent(t *testing.T) { + t.Parallel() // MODIFIED: added var buf bytes.Buffer enc := NewEncoder(&buf) enc.SetIndent(">", ".") @@ -106,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 { @@ -174,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. @@ -206,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 @@ -242,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 @@ -266,6 +271,7 @@ func TestRawMessage(t *testing.T) { } func TestNullRawMessage(t *testing.T) { + t.Parallel() // MODIFIED: added var data struct { X float64 Id RawMessage @@ -298,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 @@ -332,6 +339,7 @@ func BenchmarkEncoderEncode(b *testing.B) { }) } +//nolint:dupword // False positive, this is commented-out code, not a real comment. // MODIFIED: added nolint declaration /* // MODIFIED: we don't have tokens type tokenStreamCase struct { json string @@ -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) { @@ -459,7 +468,7 @@ func TestHTTPDecoding(t *testing.T) { defer ts.Close() res, err := http.Get(ts.URL) if err != nil { - log.Fatalf("GET failed: %v", err) + t.Fatalf("GET failed: %v", err) // MODIFIED: changed from log.Fatalf to t.Fatalf } defer res.Body.Close() |