Skip to content

Commit

Permalink
hclsyntax: New tests for marks+refinments together
Browse files Browse the repository at this point in the history
The interactions between value marks and unknown value refinements can be
a little tricky, so this pair of new tests cover two examples of that
interaction that are currently working and ought to stay that way.
  • Loading branch information
apparentlymart committed Oct 6, 2023
1 parent cc6d1d0 commit 6ec7124
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions hclsyntax/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,26 @@ upper(
}).Mark("sensitive"),
0,
},
{ // splat with sensitive collection that's unknown
`maps.*.enabled`,
&hcl.EvalContext{
Variables: map[string]cty.Value{
"maps": cty.UnknownVal(cty.List(cty.Map(cty.Bool))).Mark("sensitive"),
},
},
cty.UnknownVal(cty.List(cty.Bool)).RefineNotNull().Mark("sensitive"),
0,
},
{ // splat with sensitive collection that's unknown and not null
`maps.*.enabled`,
&hcl.EvalContext{
Variables: map[string]cty.Value{
"maps": cty.UnknownVal(cty.List(cty.Map(cty.Bool))).RefineNotNull().Mark("sensitive"),
},
},
cty.UnknownVal(cty.List(cty.Bool)).RefineNotNull().Mark("sensitive"),
0,
},
{ // splat with collection with sensitive elements
`maps.*.x`,
&hcl.EvalContext{
Expand Down

0 comments on commit 6ec7124

Please sign in to comment.