diff --git a/plans/objchange/objchange_test.go b/plans/objchange/objchange_test.go index 3e0784808..5106feb1f 100644 --- a/plans/objchange/objchange_test.go +++ b/plans/objchange/objchange_test.go @@ -572,7 +572,7 @@ func TestProposedNewObject(t *testing.T) { }), }), }, - "nested list in sed": { + "nested list in set": { &configschema.Block{ BlockTypes: map[string]*configschema.NestedBlock{ "foo": { @@ -636,6 +636,44 @@ func TestProposedNewObject(t *testing.T) { }), }), }, + "empty nested list in set": { + &configschema.Block{ + BlockTypes: map[string]*configschema.NestedBlock{ + "foo": { + Nesting: configschema.NestingSet, + Block: configschema.Block{ + BlockTypes: map[string]*configschema.NestedBlock{ + "bar": { + Nesting: configschema.NestingList, + Block: configschema.Block{}, + }, + }, + }, + }, + }, + }, + cty.ObjectVal(map[string]cty.Value{ + "foo": cty.SetVal([]cty.Value{ + cty.ObjectVal(map[string]cty.Value{ + "bar": cty.ListValEmpty((&configschema.Block{}).ImpliedType()), + }), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "foo": cty.SetVal([]cty.Value{ + cty.ObjectVal(map[string]cty.Value{ + "bar": cty.ListValEmpty((&configschema.Block{}).ImpliedType()), + }), + }), + }), + cty.ObjectVal(map[string]cty.Value{ + "foo": cty.SetVal([]cty.Value{ + cty.ObjectVal(map[string]cty.Value{ + "bar": cty.ListValEmpty((&configschema.Block{}).ImpliedType()), + }), + }), + }), + }, } for name, test := range tests {