Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barryib committed Nov 12, 2020
1 parent 1ebd25d commit d86c215
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 d86c215

Please sign in to comment.