failing test for cty conversion bug

This commit is contained in:
James Bardin 2019-05-16 16:40:17 -04:00
parent bec4641867
commit c391f3a1a3
2 changed files with 43 additions and 0 deletions

View File

@ -28,6 +28,24 @@ func testResourceConfigMode() *schema.Resource {
},
},
},
"nested_set": {
Type: schema.TypeSet,
Optional: true,
ConfigMode: schema.SchemaConfigModeAttr,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"value": {
Type: schema.TypeString,
Optional: true,
},
"set": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
},
},
},
},
}
}

View File

@ -93,3 +93,28 @@ resource "test_resource_config_mode" "foo" {
},
})
}
func TestResourceConfigMode_nestedSet(t *testing.T) {
resource.UnitTest(t, resource.TestCase{
Providers: testAccProviders,
CheckDestroy: testAccCheckResourceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: strings.TrimSpace(`
resource "test_resource_config_mode" "foo" {
resource_as_attr = []
nested_set {
value = "a"
}
nested_set {
value = "b"
set = []
}
}
`),
Check: resource.ComposeTestCheckFunc(),
},
},
})
}