Added support for shorthand splat[] for filter,reverse,sort,shuffle

This commit is contained in:
Mike Farah
2024-06-15 22:13:58 +10:00
parent d9af2dd976
commit 45eda8dbae
6 changed files with 67 additions and 6 deletions
+11
View File
@@ -11,6 +11,17 @@ var shuffleOperatorScenarios = []expressionScenario{
"D0, P[], (!!seq)::[5, 2, 4, 1, 3]\n",
},
},
{
description: "Shuffle array",
skipDoc: true,
document: "[1, 2, 3]",
expression: `shuffle[]`,
expected: []string{
"D0, P[2], (!!int)::3\n",
"D0, P[0], (!!int)::1\n",
"D0, P[1], (!!int)::2\n",
},
},
{
description: "Shuffle array in place",