Skip to content

Commit

Permalink
failing test for nested set types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Jan 18, 2023
1 parent 93f739e commit e661e91
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions internal/plans/objchange/objchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,66 @@ func TestProposedNew(t *testing.T) {
}),
}),
},

// A nested object with computed attributes, which is contained in an
// optional+computed set. The nested computed values should be
// represented in the proposed new object, and correlated with state
// via the non-computed attributes.
"config within optional+computed set": {
&configschema.Block{
Attributes: map[string]*configschema.Attribute{
"list_obj": {
Optional: true,
Computed: true,
NestedType: &configschema.Object{
Nesting: configschema.NestingSet,
Attributes: map[string]*configschema.Attribute{
"obj": {
Optional: true,
NestedType: &configschema.Object{
Nesting: configschema.NestingSingle,
Attributes: map[string]*configschema.Attribute{
"optional": {Type: cty.String, Optional: true},
"computed": {Type: cty.String, Computed: true},
},
},
},
},
},
},
},
},
cty.ObjectVal(map[string]cty.Value{
"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"),
}),
}),
}),
}),
cty.ObjectVal(map[string]cty.Value{
"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.NullVal(cty.String),
}),
}),
}),
}),
cty.ObjectVal(map[string]cty.Value{
"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"),
}),
}),
}),
}),
},
}

for name, test := range tests {
Expand Down

0 comments on commit e661e91

Please sign in to comment.