From ac4f5fe2f99e26a7b74f4c1cd5eca8929307ec51 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 18 Jan 2023 15:06:40 -0500 Subject: [PATCH] reformat --- internal/plans/objchange/objchange_test.go | 58 +++++++++++++++++----- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/internal/plans/objchange/objchange_test.go b/internal/plans/objchange/objchange_test.go index fccf6e0bd155..db613b34967f 100644 --- a/internal/plans/objchange/objchange_test.go +++ b/internal/plans/objchange/objchange_test.go @@ -1378,12 +1378,14 @@ func TestProposedNew(t *testing.T) { }), }), cty.ObjectVal(map[string]cty.Value{ - "bar": cty.SetVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{ - "optional": cty.StringVal("other_prior"), - "computed": cty.StringVal("other_prior"), - "optional_computed": cty.StringVal("other_prior"), - "required": cty.StringVal("other_prior"), - })}), + "bar": cty.SetVal([]cty.Value{ + cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("other_prior"), + "computed": cty.StringVal("other_prior"), + "optional_computed": cty.StringVal("other_prior"), + "required": cty.StringVal("other_prior"), + }), + }), }), }), }), @@ -1712,7 +1714,9 @@ func TestProposedNew(t *testing.T) { }), }, - // data sources are planned with an unknown value + // Data sources are planned with an unknown value. + // Note that this plan fails AssertPlanValid, because for managed + // resources an instance would never be completely unknown. "unknown prior nested objects": { &configschema.Block{ Attributes: map[string]*configschema.Attribute{ @@ -1910,8 +1914,14 @@ func TestProposedNew(t *testing.T) { "list_obj": cty.SetVal([]cty.Value{ cty.ObjectVal(map[string]cty.Value{ "obj": cty.ObjectVal(map[string]cty.Value{ - "optional": cty.StringVal("prior"), - "computed": cty.StringVal("prior computed"), + "optional": cty.StringVal("first"), + "computed": cty.StringVal("first computed"), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "obj": cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("second"), + "computed": cty.StringVal("second computed"), }), }), }), @@ -1920,7 +1930,19 @@ func TestProposedNew(t *testing.T) { "list_obj": cty.SetVal([]cty.Value{ cty.ObjectVal(map[string]cty.Value{ "obj": cty.ObjectVal(map[string]cty.Value{ - "optional": cty.StringVal("prior"), + "optional": cty.StringVal("first"), + "computed": cty.NullVal(cty.String), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "obj": cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("second"), + "computed": cty.NullVal(cty.String), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "obj": cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("third"), "computed": cty.NullVal(cty.String), }), }), @@ -1930,8 +1952,20 @@ func TestProposedNew(t *testing.T) { "list_obj": cty.SetVal([]cty.Value{ cty.ObjectVal(map[string]cty.Value{ "obj": cty.ObjectVal(map[string]cty.Value{ - "optional": cty.StringVal("prior"), - "computed": cty.StringVal("prior computed"), + "optional": cty.StringVal("first"), + "computed": cty.StringVal("first computed"), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "obj": cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("second"), + "computed": cty.StringVal("second computed"), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "obj": cty.ObjectVal(map[string]cty.Value{ + "optional": cty.StringVal("third"), + "computed": cty.NullVal(cty.String), }), }), }),