diff --git a/lang/functions_test.go b/lang/functions_test.go index d27a487af9..d226a32aaf 100644 --- a/lang/functions_test.go +++ b/lang/functions_test.go @@ -472,6 +472,12 @@ func TestFunctions(t *testing.T) { `jsonencode({"hello"="world"})`, cty.StringVal("{\"hello\":\"world\"}"), }, + // We are intentionally choosing to escape <, >, and & characters + // to preserve backwards compatibility with Terraform 0.11 + { + `jsonencode({"hello"=""})`, + cty.StringVal("{\"hello\":\"\\u003ccats \\u0026 kittens\\u003e\"}"), + }, }, "keys": {