Skip to content

Commit

Permalink
empty set of empty objects cross test
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed May 19, 2024
1 parent 5bee956 commit 8c88d23
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pkg/tests/cross-tests/input_cross_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,32 @@ func TestNonEmptyNestedMaxItemsOnes(t *testing.T) {
})
}
}

func TestEmptySetOfEmptyObjects(t *testing.T) {
skipUnlessLinux(t)
t.Skipf("Fix")
// TODO
// RawPlan not equal!
// TF value cty.ObjectVal(map[string]cty.Value{"d2f0":cty.SetVal([]cty.Value{cty.EmptyObjectVal}), "d2f1":cty.SetVal([]cty.Value{cty.EmptyObjectVal}), "id":cty.UnknownVal(cty.String)})
// PU value cty.ObjectVal(map[string]cty.Value{"d2f0":cty.SetValEmpty(cty.EmptyObject), "d2f1":cty.SetVal([]cty.Value{cty.EmptyObjectVal}), "id":cty.UnknownVal(cty.String)})
t1 := tftypes.Object{}
t0 := tftypes.Object{AttributeTypes: map[string]tftypes.Type{
"d3f0": tftypes.Set{ElementType: t1},
}}
config := tftypes.NewValue(t0, map[string]tftypes.Value{
"d3f0": tftypes.NewValue(tftypes.Set{ElementType: t1}, []tftypes.Value{}),
})

runCreateInputCheck(t, inputTestCase{
Resource: &schema.Resource{
Schema: map[string]*schema.Schema{
"d3f0": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{Schema: map[string]*schema.Schema{}},
},
},
},
Config: config,
})
}

0 comments on commit 8c88d23

Please sign in to comment.