Skip to content

Commit

Permalink
✅ Add map and seq tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 31, 2022
1 parent 61fca6e commit a199ddb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ 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},
{"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 a199ddb

Please sign in to comment.