mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 10:04:43 +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:
@@ -94,6 +94,30 @@ var tomlScenarios = []formatScenario{
|
||||
expected: "person:\n name: hello\n address: 12 cat st\n",
|
||||
scenarioType: "decode",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Parse: include key information",
|
||||
input: "person.name = \"hello\"\nperson.address = \"12 cat st\"\n",
|
||||
expression: ".person.name | key",
|
||||
expected: "name\n",
|
||||
scenarioType: "roundtrip",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Parse: include parent information",
|
||||
input: "person.name = \"hello\"\nperson.address = \"12 cat st\"\n",
|
||||
expression: ".person.name | parent",
|
||||
expected: "name: hello\naddress: 12 cat st\n",
|
||||
scenarioType: "decode",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Parse: include path information",
|
||||
input: "person.name = \"hello\"\nperson.address = \"12 cat st\"\n",
|
||||
expression: ".person.name | path",
|
||||
expected: "- person\n- name\n",
|
||||
scenarioType: "decode",
|
||||
},
|
||||
{
|
||||
description: "Encode: Scalar",
|
||||
input: "person.name = \"hello\"\nperson.address = \"12 cat st\"\n",
|
||||
|
||||
Reference in New Issue
Block a user