mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-04 00:14:55 +08:00
wip - reduce!
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package yqlib
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var reduceOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
document: `[10,2, 5, 3]`,
|
||||
expression: `.[] as $item reduce (0; . + $item)`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!int)::20\n",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestReduceOperatorScenarios(t *testing.T) {
|
||||
for _, tt := range reduceOperatorScenarios {
|
||||
testScenario(t, &tt)
|
||||
}
|
||||
// documentScenarios(t, "Reduce", reduceOperatorScenarios)
|
||||
}
|
||||
Reference in New Issue
Block a user