hclsyntax: Additional tests for template sequence escapes
In previous versions we had some bugs around template sequence escapes. These tests show that they no longer seem to be present, and should hopefully avoid them regressing in future.
This commit is contained in:
parent
22ba006718
commit
2c66cf702c
@ -84,6 +84,12 @@ hello world
|
||||
cty.StringVal("hello $$nonescape"),
|
||||
0,
|
||||
},
|
||||
{
|
||||
`hello %${"world"}`,
|
||||
nil,
|
||||
cty.StringVal("hello %world"),
|
||||
0,
|
||||
},
|
||||
{
|
||||
`${true}`,
|
||||
nil,
|
||||
@ -253,6 +259,30 @@ trim`,
|
||||
cty.StringVal("%%"),
|
||||
0,
|
||||
},
|
||||
{
|
||||
`hello %%{ if true }world%%{ endif }`,
|
||||
nil,
|
||||
cty.StringVal(`hello %{ if true }world%{ endif }`),
|
||||
0,
|
||||
},
|
||||
{
|
||||
`hello $%{ if true }world%{ endif }`,
|
||||
nil,
|
||||
cty.StringVal("hello $world"),
|
||||
0,
|
||||
},
|
||||
{
|
||||
`%{ endif }`,
|
||||
nil,
|
||||
cty.UnknownVal(cty.String),
|
||||
1, // Unexpected endif directive
|
||||
},
|
||||
{
|
||||
`%{ endfor }`,
|
||||
nil,
|
||||
cty.UnknownVal(cty.String),
|
||||
1, // Unexpected endfor directive
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user