fix: Make sure len([BODY]) works if the body is a JSON array

Fixes #359
This commit is contained in:
TwiN committed 2022-11-03 20:50:40 -04:00
1 parent ed3683cb32
commit 1f84f2afa0
3 files changed
+32 -3

No files matched your search

+8
View File
@@ -62,6 +62,14 @@ func TestEval(t *testing.T) {
ExpectedOutputLength: 1,
ExpectedError: false,
},
{
Name: "array-of-values-with-no-path",
Path: "",
Data: `[1, 2]`,
ExpectedOutput: "[1 2]", // the output is an array
ExpectedOutputLength: 2,
ExpectedError: false,
},
{
Name: "array-of-values-and-invalid-index",
Path: "ids[wat]",