mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
fix: correct key order after add, flatten, keys, sort, reverse and shuffle
Signed-off-by: Antoine Deschênes <antoine.deschenes@linux.com>
This commit is contained in:
committed by
Mike Farah
parent
b84fd47934
commit
b15ce77cad
@@ -17,8 +17,8 @@ var sortByOperatorScenarios = []expressionScenario{
|
||||
document: "[{a: banana},{a: apple}]",
|
||||
expression: `sort_by(.a)[]`,
|
||||
expected: []string{
|
||||
"D0, P[1], (!!map)::{a: apple}\n",
|
||||
"D0, P[0], (!!map)::{a: banana}\n",
|
||||
"D0, P[0], (!!map)::{a: apple}\n",
|
||||
"D0, P[1], (!!map)::{a: banana}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -27,9 +27,9 @@ var sortByOperatorScenarios = []expressionScenario{
|
||||
document: "[{a: banana},null,{a: apple}]",
|
||||
expression: `sort_by(.a)[]`,
|
||||
expected: []string{
|
||||
"D0, P[1], (!!null)::null\n",
|
||||
"D0, P[2], (!!map)::{a: apple}\n",
|
||||
"D0, P[0], (!!map)::{a: banana}\n",
|
||||
"D0, P[0], (!!null)::null\n",
|
||||
"D0, P[1], (!!map)::{a: apple}\n",
|
||||
"D0, P[2], (!!map)::{a: banana}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -149,8 +149,8 @@ var sortByOperatorScenarios = []expressionScenario{
|
||||
document: "[8,null]",
|
||||
expression: `sort[]`,
|
||||
expected: []string{
|
||||
"D0, P[1], (!!null)::null\n",
|
||||
"D0, P[0], (!!int)::8\n",
|
||||
"D0, P[0], (!!null)::null\n",
|
||||
"D0, P[1], (!!int)::8\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user