summaryrefslogtreecommitdiff
path: root/compat/json/compat_test.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-14 18:55:57 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-25 17:55:27 -0700
commit2a41777072f48467bef02bb3bd670d95c2b02102 (patch)
treeb4ac55094c142b3967acfdbf580d161988f822b7 /compat/json/compat_test.go
parentf68498a6fdb421483d9aebb45527452f6255bb68 (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.go2
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\""},