@@ -10,9 +10,12 @@ import (
10
10
11
11
"github.com/google/go-cmp/cmp"
12
12
"github.com/google/go-cmp/cmp/cmpopts"
13
+ "github.com/segmentio/encoding/json"
13
14
)
14
15
15
- func testCancelParams (t * testing.T , marshal marshalFunc , unmarshal unmarshalFunc ) {
16
+ func TestCancelParams (t * testing.T ) {
17
+ t .Parallel ()
18
+
16
19
const want = `{"id":"testID"}`
17
20
wantType := CancelParams {
18
21
ID : "testID" ,
@@ -42,7 +45,7 @@ func testCancelParams(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc
42
45
t .Run (tt .name , func (t * testing.T ) {
43
46
t .Parallel ()
44
47
45
- got , err := marshal (& tt .field )
48
+ got , err := json . Marshal (& tt .field )
46
49
if (err != nil ) != tt .wantMarshalErr {
47
50
t .Fatal (err )
48
51
}
@@ -79,7 +82,7 @@ func testCancelParams(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc
79
82
t .Parallel ()
80
83
81
84
var got CancelParams
82
- if err := unmarshal ([]byte (tt .field ), & got ); (err != nil ) != tt .wantUnmarshalErr {
85
+ if err := json . Unmarshal ([]byte (tt .field ), & got ); (err != nil ) != tt .wantUnmarshalErr {
83
86
t .Fatal (err )
84
87
}
85
88
@@ -91,7 +94,9 @@ func testCancelParams(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc
91
94
})
92
95
}
93
96
94
- func testProgressParams (t * testing.T , marshal marshalFunc , unmarshal unmarshalFunc ) {
97
+ func TestProgressParams (t * testing.T ) {
98
+ t .Parallel ()
99
+
95
100
const wantWorkDoneToken = "156edea9-9d8d-422f-b7ee-81a84594afbb"
96
101
const want = `{"token":"` + wantWorkDoneToken + `","value":"testValue"}`
97
102
@@ -125,7 +130,7 @@ func testProgressParams(t *testing.T, marshal marshalFunc, unmarshal unmarshalFu
125
130
t .Run (tt .name , func (t * testing.T ) {
126
131
t .Parallel ()
127
132
128
- got , err := marshal (& tt .field )
133
+ got , err := json . Marshal (& tt .field )
129
134
if (err != nil ) != tt .wantMarshalErr {
130
135
t .Fatal (err )
131
136
}
@@ -162,7 +167,7 @@ func testProgressParams(t *testing.T, marshal marshalFunc, unmarshal unmarshalFu
162
167
t .Parallel ()
163
168
164
169
var got ProgressParams
165
- if err := unmarshal ([]byte (tt .field ), & got ); (err != nil ) != tt .wantUnmarshalErr {
170
+ if err := json . Unmarshal ([]byte (tt .field ), & got ); (err != nil ) != tt .wantUnmarshalErr {
166
171
t .Fatal (err )
167
172
}
168
173
0 commit comments