From 35eee537d4d8f403b746b768625674814befea4c Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Thu, 18 Feb 2021 17:59:29 +0900 Subject: [PATCH] Add test case --- decode_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/decode_test.go b/decode_test.go index 26c91fe..fc8aa66 100644 --- a/decode_test.go +++ b/decode_test.go @@ -2670,26 +2670,25 @@ func TestUnmarshalEmbeddedUnexported(t *testing.T) { } } -/* func TestUnmarshalErrorAfterMultipleJSON(t *testing.T) { tests := []struct { in string err error }{{ 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 [] [,]`, - err: json.NewSyntaxError("invalid character ',' looking for beginning of value", 7), + err: json.NewSyntaxError("not at beginning of value", 6), }, { 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"=}`, - err: json.NewSyntaxError("invalid character '=' after object key", 14), + err: json.NewSyntaxError("expected colon after object key", 13), }, { 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 { dec := json.NewDecoder(strings.NewReader(tt.in)) @@ -2705,7 +2704,6 @@ func TestUnmarshalErrorAfterMultipleJSON(t *testing.T) { } } } -*/ type unmarshalPanic struct{}