diff --git a/helper/schema/serialize_test.go b/helper/schema/serialize_test.go index 7fe9e20bf..55afb1528 100644 --- a/helper/schema/serialize_test.go +++ b/helper/schema/serialize_test.go @@ -13,7 +13,6 @@ func TestSerializeForHash(t *testing.T) { } tests := []testCase{ - testCase{ Schema: &Schema{ Type: TypeInt, @@ -193,6 +192,31 @@ func TestSerializeForHash(t *testing.T) { }, Expected: "green:1;name:my-fun-database;size:12;", }, + + // test TypeMap nested in Schema: GH-7091 + testCase{ + Schema: &Resource{ + Schema: map[string]*Schema{ + "outer": &Schema{ + Type: TypeSet, + Required: true, + Elem: &Schema{ + Type: TypeMap, + Optional: true, + }, + }, + }, + }, + Value: map[string]interface{}{ + "outer": NewSet(func(i interface{}) int { return 42 }, []interface{}{ + map[string]interface{}{ + "foo": "bar", + "baz": "foo", + }, + }), + }, + Expected: "outer:{[baz:foo;foo:bar;];};", + }, } for _, test := range tests {