Skip to content

Commit

Permalink
✅ Update map and seq tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 2, 2022
1 parent 88079e0 commit 6345555
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 6345555

Please sign in to comment.