From 5d0beaf93539e84cd3add13c9f39d170d8c463ac Mon Sep 17 00:00:00 2001 From: "Thierno IB. BARRY" Date: Sun, 17 May 2020 19:42:48 +0200 Subject: [PATCH] add tests --- lang/funcs/string_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lang/funcs/string_test.go b/lang/funcs/string_test.go index efdac48b78ae..dd816fc64a62 100644 --- a/lang/funcs/string_test.go +++ b/lang/funcs/string_test.go @@ -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{ @@ -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{