From 6345555e4f47ccd8b85a9ca54a232605127b7aa6 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Thu, 1 Sep 2022 22:35:06 -0500 Subject: [PATCH] :white_check_mark: Update map and seq tests --- cmd/cmd_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go index 1c5ab5e..2e75764 100644 --- a/cmd/cmd_test.go +++ b/cmd/cmd_test.go @@ -109,8 +109,10 @@ func Test_templateReader(t *testing.T) { {"simple", args{conf, strings.NewReader("a: a #yampl b")}, "a: b #yampl b\n", false}, {"dynamic", args{conf, strings.NewReader("a: a #yampl {{ .Value }}")}, "a: a #yampl {{ .Value }}\n", false}, {"multi-doc", args{conf, strings.NewReader("a: a\n---\nb: b")}, "a: a\n---\nb: b\n", false}, - {"map", args{conf, strings.NewReader("a: {} #yampl:map {a: a}")}, "a:\n a: a\n", false}, - {"seq", args{conf, strings.NewReader("a: {} #yampl:seq [a]")}, "a:\n - a\n", false}, + {"map flow to block", args{conf, strings.NewReader("a: {} #yampl:map {a: a}")}, "a: #yampl:map {a: a}\n a: a\n", false}, + {"map block to flow", args{conf, strings.NewReader("a: #yampl:map {}\n a: a")}, "a: {} #yampl:map {}\n", false}, + {"seq flow to block", args{conf, strings.NewReader("a: {} #yampl:seq [a]")}, "a: #yampl:seq [a]\n - a\n", false}, + {"seq block to flow", args{conf, strings.NewReader("a: #yampl:seq []\n - b")}, "a: [] #yampl:seq []\n", false}, {"invalid yaml", args{conf, strings.NewReader("a:\n- b\n c: c")}, "", true}, {"unset value allowed", args{conf, strings.NewReader("a: a #yampl {{ .b }}")}, "a: a #yampl {{ .b }}\n", false}, {"unset value error", args{failConf, strings.NewReader("a: a #yampl {{ .z }}")}, "", true},