diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-14 18:55:57 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-25 17:55:27 -0700 |
commit | 2a41777072f48467bef02bb3bd670d95c2b02102 (patch) | |
tree | b4ac55094c142b3967acfdbf580d161988f822b7 /compat/json/compat_test.go | |
parent | f68498a6fdb421483d9aebb45527452f6255bb68 (diff) |
compat/json: Handle io.EOF and io.ErrUnexpectedEOF the same
Diffstat (limited to 'compat/json/compat_test.go')
-rw-r--r-- | compat/json/compat_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compat/json/compat_test.go b/compat/json/compat_test.go index 2380c53..43f17f1 100644 --- a/compat/json/compat_test.go +++ b/compat/json/compat_test.go @@ -72,6 +72,7 @@ func TestCompatCompact(t *testing.T) { Err string } testcases := map[string]testcase{ + "empty": {In: ``, Out: ``, Err: `unexpected end of JSON input`}, "trunc": {In: `{`, Out: ``, Err: `unexpected end of JSON input`}, "object": {In: `{}`, Out: `{}`}, "non-utf8": {In: "\"\x85\xcd\"", Out: "\"\x85\xcd\""}, @@ -106,6 +107,7 @@ func TestCompatIndent(t *testing.T) { Err string } testcases := map[string]testcase{ + "empty": {In: ``, Out: ``, Err: `unexpected end of JSON input`}, "trunc": {In: `{`, Out: ``, Err: `unexpected end of JSON input`}, "object": {In: `{}`, Out: `{}`}, "non-utf8": {In: "\"\x85\xcd\"", Out: "\"\x85\xcd\""}, |