From 13c81d8504078f8f9673c5c716a144e133836481 Mon Sep 17 00:00:00 2001 From: Liam Cervante Date: Mon, 17 Oct 2022 15:32:34 +0200 Subject: [PATCH] Add example test case we would need to make work --- cty/convert/public_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cty/convert/public_test.go b/cty/convert/public_test.go index f89220e2..3a3ee511 100644 --- a/cty/convert/public_test.go +++ b/cty/convert/public_test.go @@ -993,6 +993,26 @@ func TestConvert(t *testing.T) { cty.NullVal(cty.DynamicPseudoType), }), }, + { + Value: cty.MapVal(map[string]cty.Value{ + "a": cty.StringVal("boop"), + }), + Type: cty.ObjectWithOptionalAttrs(map[string]cty.Type{ + "a": cty.String, + "b": cty.String, + "c": cty.Object(map[string]cty.Type{ + "d": cty.String, + }), + }, []string{"b", "c"}), + Want: cty.ObjectVal(map[string]cty.Value{ + "a": cty.StringVal("boop"), + "b": cty.NullVal(cty.String), + "c": cty.NullVal(cty.Object(map[string]cty.Type{ + "d": cty.String, + })), + }), + WantError: false, + }, { Value: cty.ListVal([]cty.Value{ cty.ObjectVal(map[string]cty.Value{