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

Fixes #359
This commit is contained in:
TwiN
2022-11-03 20:46:35 -04:00
parent ed3683cb32
commit 1f84f2afa0
3 changed files with 32 additions and 3 deletions

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]",