Skip to content

Commit 63255da

Browse files
committed
fix test response, remove spaces and escapedquotes
1 parent f9f9cd1 commit 63255da

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

query/encode_test.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,19 @@ func TestValues_EmbeddedStructs(t *testing.T) {
404404
}
405405
}
406406

407-
408407
func TestValues_StructsAsJSON(t *testing.T) {
408+
type Nested struct {
409+
L bool `json:"l"`
410+
M bool `json:"m"`
411+
}
409412
type Inner struct {
410413
A string `json:"a"`
411-
B int `json:"b"`
412-
T struct {
413-
L bool `json:"l"`
414-
M bool `json:"m"`
415-
} `json:"t"`
414+
B int `json:"b"`
415+
T Nested `json:"t"`
416416
}
417417

418418
type Outer struct {
419-
S Inner `url:"str,json"`
419+
S Inner `url:"str,json"`
420420
P *Inner `url:"ptr,json,omitempty"`
421421
}
422422

@@ -425,20 +425,19 @@ func TestValues_StructsAsJSON(t *testing.T) {
425425
want url.Values
426426
}{
427427
{
428-
Outer {
429-
S: Inner {
428+
Outer{
429+
S: Inner{
430430
A: "abc",
431431
B: 5,
432-
T: struct {
433-
L bool `json:"l"`
434-
M bool `json:"m"`
435-
} `json:"t"`,
432+
T: Nested{
433+
L: true,
434+
M: false,
435+
},
436436
},
437437
P: nil,
438438
},
439439
url.Values{
440-
"str": {"{\"a\": \"abc\", \"b\": 5, \"t\": {\"l\": false, \"m\": false}}"},
441-
"ptr": {""},
440+
"str": {`{"a":"abc","b":5,"t":{"l":true,"m":false}}`},
442441
},
443442
},
444443
{

0 commit comments

Comments
 (0)