Fixed value operator bug #1515

This commit is contained in:
Mike Farah
2023-01-12 15:11:45 +11:00
parent fcda053d73
commit d7da0cca3c
7 changed files with 55 additions and 7 deletions
+22
View File
@@ -12,6 +12,28 @@ var valueOperatorScenarios = []expressionScenario{
"D0, P[], (!!int)::1\n",
},
},
{
document: `[1,2,3]`,
expression: `.[] | "foo"`,
expected: []string{
"D0, P[], (!!str)::foo\n",
"D0, P[], (!!str)::foo\n",
"D0, P[], (!!str)::foo\n",
},
},
{
document: `[1,2,3]`,
expression: `[.[] | "foo"] | .[0] = "cat"`,
expected: []string{
"D0, P[], (!!seq)::- cat\n- foo\n- foo\n",
},
},
{
expression: `"foo"`,
expected: []string{
"D0, P[], (!!str)::foo\n",
},
},
{
document: ``,
expression: `0x9f`,