From 56966290cec9e5caa9d2c9c3b551ddd4dc9a7309 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 d7ed9edb..134d0a05 100644 --- a/cty/convert/public_test.go +++ b/cty/convert/public_test.go @@ -991,6 +991,26 @@ func TestConvert(t *testing.T) { }), WantError: false, }, + { + 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{