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 authored and apparentlymart committed Oct 19, 2022
1 parent 82eaa67 commit 13c81d8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cty/convert/public_test.go
Expand Up @@ -993,6 +993,26 @@ func TestConvert(t *testing.T) {
cty.NullVal(cty.DynamicPseudoType),
}),
},
{
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 13c81d8

Please sign in to comment.