mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +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:
+4
-12
@@ -364,11 +364,10 @@ var xmlScenarios = []formatScenario{
|
||||
expected: "zoo:\n animal:\n - cat\n",
|
||||
},
|
||||
{
|
||||
description: "Parse xml: force all as an array",
|
||||
subdescription: "Because of the way yq works, when updating everything you need to update the children before the parents. By default `..` will match parents first, so we reverse that before updating.",
|
||||
input: "<zoo><thing><frog>boing</frog></thing></zoo>",
|
||||
expression: "([..] | reverse | .[]) |= [] + .",
|
||||
expected: "- zoo:\n - thing:\n - frog:\n - boing\n",
|
||||
description: "Parse xml: force all as an array",
|
||||
input: "<zoo><thing><frog>boing</frog></thing></zoo>",
|
||||
expression: ".. |= [] + .",
|
||||
expected: "- zoo:\n - thing:\n - frog:\n - boing\n",
|
||||
},
|
||||
{
|
||||
description: "Parse xml: attributes",
|
||||
@@ -537,13 +536,6 @@ var xmlScenarios = []formatScenario{
|
||||
expectedError: "cannot encode !!seq to XML - only maps can be encoded",
|
||||
scenarioType: "encode-error",
|
||||
},
|
||||
{
|
||||
description: "scalars cannot be encoded",
|
||||
skipDoc: true,
|
||||
input: "mike",
|
||||
expectedError: "cannot encode !!str to XML - only maps can be encoded",
|
||||
scenarioType: "encode-error",
|
||||
},
|
||||
{
|
||||
description: "Encode xml: attributes with content",
|
||||
subdescription: "Fields with the matching xml-content-name is assumed to be content.",
|
||||
|
||||
Reference in New Issue
Block a user