Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierno IB. BARRY committed May 17, 2020
1 parent 4c7a863 commit 5d0beaf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lang/funcs/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ func TestTemplate(t *testing.T) {
cty.NilVal,
`vars map does not contain key "name", referenced at str:1,10-14`,
},
{
cty.StringVal("\xDF"),
cty.EmptyObjectVal,
cty.NilVal,
`str:1,1-2: Invalid character encoding; All input files must be UTF-8 encoded. Ensure that UTF-8 encoding is selected in your editor., and 1 other diagnostic(s)`,
},
{
cty.StringVal(""),
cty.MapVal(map[string]cty.Value{
Expand All @@ -95,6 +101,12 @@ func TestTemplate(t *testing.T) {
cty.StringVal(""),
``,
},
{
cty.NilVal,
cty.EmptyObjectVal,
cty.NilVal,
`argument must not be null`,
},
{
cty.StringVal("Hello, ${name}!"),
cty.MapVal(map[string]cty.Value{
Expand Down

0 comments on commit 5d0beaf

Please sign in to comment.