mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Generic ast (#1829)
Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
This commit is contained in:
@@ -28,7 +28,7 @@ var documentIndexScenarios = []expressionScenario{
|
||||
document: "a: cat\n---\na: frog\n",
|
||||
expression: `select(document_index == 1)`,
|
||||
expected: []string{
|
||||
"D1, P[], (doc)::a: frog\n",
|
||||
"D1, P[], (!!map)::a: frog\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -36,7 +36,7 @@ var documentIndexScenarios = []expressionScenario{
|
||||
document: "a: cat\n---\na: frog\n",
|
||||
expression: `select(di == 1)`,
|
||||
expected: []string{
|
||||
"D1, P[], (doc)::a: frog\n",
|
||||
"D1, P[], (!!map)::a: frog\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -45,7 +45,7 @@ var documentIndexScenarios = []expressionScenario{
|
||||
expression: `.a | ({"match": ., "doc": document_index})`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!map)::match: cat\ndoc: 0\n",
|
||||
"D0, P[], (!!map)::match: frog\ndoc: 1\n",
|
||||
"D1, P[], (!!map)::match: frog\ndoc: 1\n",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user