From 61705df0897d6fc787410aca5bf7b1ee9644f5e2 Mon Sep 17 00:00:00 2001 From: KimHyeonwoo Date: Mon, 18 Jul 2022 21:34:12 +0900 Subject: [PATCH] add test --- decode_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/decode_test.go b/decode_test.go index c276a32..8c8561b 100644 --- a/decode_test.go +++ b/decode_test.go @@ -3985,3 +3985,18 @@ func TestIssue372(t *testing.T) { t.Errorf("unexpected result: %v != %v", got, expected) } } + +type issue384 string + +func (t *issue384) UnmarshalJSON(b []byte) error { + return nil +} + +func TestIssue384(t *testing.T) { + in := "{\"data\":{\"text\": \"" + strings.Repeat("-", 492) + "\\\"\"}}\n" + dec := json.NewDecoder(strings.NewReader(in)) + var v issue384 + if err := dec.Decode(&v); err != nil { + t.Errorf("unexpected error: %v", err) + } +}