mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 10:04:43 +08:00
Fixed merged anchor reference problem #1482
This commit is contained in:
@@ -4,6 +4,11 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var mergeAnchorAssign = `a: &a
|
||||
x: OriginalValue
|
||||
b:
|
||||
<<: *a`
|
||||
|
||||
var assignOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
description: "Create yaml file",
|
||||
@@ -20,6 +25,14 @@ var assignOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (doc)::a: null\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: mergeAnchorAssign,
|
||||
expression: `.c = .b | .a.x = "ModifiedValue" | explode(.)`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::a:\n x: ModifiedValue\nb:\n x: ModifiedValue\nc:\n x: ModifiedValue\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: "{}",
|
||||
|
||||
Reference in New Issue
Block a user