mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +08:00
wip
This commit is contained in:
@@ -5,6 +5,9 @@ import (
|
||||
)
|
||||
|
||||
var multiplyOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
description: "*+ doc",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `{a: {also: [1]}, b: {also: me}}`,
|
||||
@@ -80,15 +83,15 @@ var multiplyOperatorScenarios = []expressionScenario{
|
||||
description: "Merge keeps style of LHS",
|
||||
dontFormatInputForDoc: true,
|
||||
document: `a: {things: great}
|
||||
b:
|
||||
also: "me"
|
||||
`,
|
||||
b:
|
||||
also: "me"
|
||||
`,
|
||||
expression: `. * {"a":.b}`,
|
||||
expected: []string{
|
||||
`D0, P[], (!!map)::a: {things: great, also: "me"}
|
||||
b:
|
||||
also: "me"
|
||||
`,
|
||||
b:
|
||||
also: "me"
|
||||
`,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -99,6 +102,22 @@ b:
|
||||
"D0, P[], (!!map)::{a: [3, 4, 5], b: [3, 4, 5]}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `{a: [1], b: [2]}`,
|
||||
expression: `.a *+ .b`,
|
||||
expected: []string{
|
||||
"D0, P[a], (!!seq)::[1, 2]\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Merge, appending arrays",
|
||||
document: `{a: {array: [1, 2, animal: dog], value: coconut}, b: {array: [3, 4, animal: cat], value: banana}}`,
|
||||
expression: `.a *+ .b`,
|
||||
expected: []string{
|
||||
"D0, P[a], (!!map)::{array: [1, 2, {animal: dog}, 3, 4, {animal: cat}], value: banana}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Merge to prefix an element",
|
||||
document: `{a: cat, b: dog}`,
|
||||
|
||||
Reference in New Issue
Block a user