mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +08:00
wip
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package yqlib
|
||||
|
||||
import "testing"
|
||||
|
||||
var sortByOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
description: "Sort by string field",
|
||||
document: "[{a: banana},{a: cat},{a: apple}]",
|
||||
expression: `sort_by(.a)`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!bool)::true\n",
|
||||
},
|
||||
},
|
||||
// {
|
||||
// description: "Sort, nulls come first",
|
||||
// document: "[8,3,null,6]",
|
||||
// expression: `sort`,
|
||||
// expected: []string{
|
||||
// "D0, P[], (!!bool)::[null,3,6,8]\n",
|
||||
// },
|
||||
// },
|
||||
}
|
||||
|
||||
func TestSortByOperatorScenarios(t *testing.T) {
|
||||
for _, tt := range sortByOperatorScenarios {
|
||||
testScenario(t, &tt)
|
||||
}
|
||||
documentScenarios(t, "Sort", sortByOperatorScenarios)
|
||||
}
|
||||
Reference in New Issue
Block a user