From 9e21ad5861e83924608017c9a19acb4820fbf9e1 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Fri, 18 Dec 2020 14:30:01 -0500 Subject: [PATCH] Test splat of collection including marked elements --- hclsyntax/expression_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hclsyntax/expression_test.go b/hclsyntax/expression_test.go index f3bc2ca..1ff75e4 100644 --- a/hclsyntax/expression_test.go +++ b/hclsyntax/expression_test.go @@ -1172,6 +1172,26 @@ upper( }).Mark("sensitive"), 0, }, + { // splat with collection with sensitive elements + `maps.*.x`, + &hcl.EvalContext{ + Variables: map[string]cty.Value{ + "maps": cty.ListVal([]cty.Value{ + cty.MapVal(map[string]cty.Value{ + "x": cty.StringVal("foo").Mark("sensitive"), + }), + cty.MapVal(map[string]cty.Value{ + "x": cty.StringVal("bar"), + }), + }), + }, + }, + cty.ListVal([]cty.Value{ + cty.StringVal("foo").Mark("sensitive"), + cty.StringVal("bar"), + }), + 0, + }, { `["hello"][0]`, nil,