1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Fixed explode for simple anchors

This commit is contained in:
Mike Farah
2020-02-07 09:08:52 +11:00
parent b116f40348
commit 108b5cb093
3 changed files with 18 additions and 4 deletions

View File

@@ -293,6 +293,20 @@ func TestReadMergeAnchorsExplodeJsonCmd(t *testing.T) {
test.AssertResult(t, expectedOutput, result.Output)
}
func TestReadMergeAnchorsExplodeSimpleCmd(t *testing.T) {
cmd := getRootCommand()
result := test.RunCmd(cmd, "read -X ../examples/simple-anchor.yaml")
if result.Error != nil {
t.Error(result.Error)
}
expectedOutput := `foo:
a: 1
foobar:
a: 1
`
test.AssertResult(t, expectedOutput, result.Output)
}
func TestReadMergeAnchorsExplodeCmd(t *testing.T) {
cmd := getRootCommand()
result := test.RunCmd(cmd, "read -X ../examples/merge-anchor.yaml")