mirror of https://github.com/goccy/go-json.git
Add test case
This commit is contained in:
parent
6eb23deb6f
commit
35eee537d4
|
@ -2670,26 +2670,25 @@ func TestUnmarshalEmbeddedUnexported(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func TestUnmarshalErrorAfterMultipleJSON(t *testing.T) {
|
func TestUnmarshalErrorAfterMultipleJSON(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
in string
|
in string
|
||||||
err error
|
err error
|
||||||
}{{
|
}{{
|
||||||
in: `1 false null :`,
|
in: `1 false null :`,
|
||||||
err: json.NewSyntaxError("invalid character ':' looking for beginning of value", 14),
|
err: json.NewSyntaxError("not at beginning of value", 14),
|
||||||
}, {
|
}, {
|
||||||
in: `1 [] [,]`,
|
in: `1 [] [,]`,
|
||||||
err: json.NewSyntaxError("invalid character ',' looking for beginning of value", 7),
|
err: json.NewSyntaxError("not at beginning of value", 6),
|
||||||
}, {
|
}, {
|
||||||
in: `1 [] [true:]`,
|
in: `1 [] [true:]`,
|
||||||
err: json.NewSyntaxError("invalid character ':' after array element", 11),
|
err: json.NewSyntaxError("json: slice unexpected end of JSON input", 10),
|
||||||
}, {
|
}, {
|
||||||
in: `1 {} {"x"=}`,
|
in: `1 {} {"x"=}`,
|
||||||
err: json.NewSyntaxError("invalid character '=' after object key", 14),
|
err: json.NewSyntaxError("expected colon after object key", 13),
|
||||||
}, {
|
}, {
|
||||||
in: `falsetruenul#`,
|
in: `falsetruenul#`,
|
||||||
err: json.NewSyntaxError("invalid character '#' in literal null (expecting 'l')", 13),
|
err: json.NewSyntaxError("json: invalid character # as null", 12),
|
||||||
}}
|
}}
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
dec := json.NewDecoder(strings.NewReader(tt.in))
|
dec := json.NewDecoder(strings.NewReader(tt.in))
|
||||||
|
@ -2705,7 +2704,6 @@ func TestUnmarshalErrorAfterMultipleJSON(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
type unmarshalPanic struct{}
|
type unmarshalPanic struct{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue