Fixed empty array json bug #1880

This commit is contained in:
Mike Farah
2023-11-23 11:53:18 +11:00
parent 1cf9ecc79d
commit 26effddb8c
2 changed files with 28 additions and 2 deletions
+21
View File
@@ -80,6 +80,27 @@ const roundTripMultiLineJson = `{
`
var jsonScenarios = []formatScenario{
{
description: "array empty",
skipDoc: true,
input: "[]",
scenarioType: "roundtrip-ndjson",
expected: "[]\n",
},
{
description: "array has scalar",
skipDoc: true,
input: "[3]",
scenarioType: "roundtrip-ndjson",
expected: "[3]\n",
},
{
description: "array has object",
skipDoc: true,
input: `[{"x": 3}]`,
scenarioType: "roundtrip-ndjson",
expected: "[{\"x\":3}]\n",
},
{
description: "array null",
skipDoc: true,