Skip to content

Commit

Permalink
Add example test case we would need to make work
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcervante committed Oct 17, 2022
1 parent 8548fbb commit 5696629
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cty/convert/public_test.go
Expand Up @@ -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{
Expand Down

0 comments on commit 5696629

Please sign in to comment.