From 7dabc57b65b8bfb843ad2172af0a90e3e531f6e2 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sun, 13 Sep 2020 11:12:52 +1000 Subject: [PATCH] Added array update merge example --- cmd/merge_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/merge_test.go b/cmd/merge_test.go index 6a292190..a3d5f79c 100644 --- a/cmd/merge_test.go +++ b/cmd/merge_test.go @@ -339,6 +339,19 @@ func TestMergeOverwriteArraysCmd(t *testing.T) { test.AssertResult(t, expectedOutput, result.Output) } +func TestMergeUpdateArraysCmd(t *testing.T) { + cmd := getRootCommand() + result := test.RunCmd(cmd, "merge -x --arrays=update ../examples/sample_array.yaml ../examples/sample_array_2.yaml") + if result.Error != nil { + t.Error(result.Error) + } + expectedOutput := `- 4 +- 5 +- 3 +` + test.AssertResult(t, expectedOutput, result.Output) +} + func TestMergeCmd_Multi(t *testing.T) { cmd := getRootCommand() result := test.RunCmd(cmd, "merge -d1 ../examples/multiple_docs_small.yaml ../examples/data1.yaml")