diff --git a/helper/schema/core_schema_test.go b/helper/schema/core_schema_test.go index 197e9b2f3..94669c788 100644 --- a/helper/schema/core_schema_test.go +++ b/helper/schema/core_schema_test.go @@ -11,8 +11,8 @@ import ( ) var ( - ignoreUnexported = cmpopts.IgnoreUnexported(cty.Type{}) - equateEmpty = cmpopts.EquateEmpty() + equateEmpty = cmpopts.EquateEmpty() + typeComparer = cmp.Comparer(cty.Type.Equals) ) // add the implicit "id" attribute for test resources @@ -305,8 +305,8 @@ func TestSchemaMapCoreConfigSchema(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { got := schemaMap(test.Schema).CoreConfigSchema() - if !cmp.Equal(got, test.Want, equateEmpty, ignoreUnexported) { - cmp.Diff(got, test.Want, equateEmpty, ignoreUnexported) + if !cmp.Equal(got, test.Want, typeComparer) { + cmp.Diff(got, test.Want, typeComparer) } }) } diff --git a/helper/schema/provider_test.go b/helper/schema/provider_test.go index 2a45a97d7..6bf8c5bdf 100644 --- a/helper/schema/provider_test.go +++ b/helper/schema/provider_test.go @@ -91,8 +91,8 @@ func TestProviderGetSchema(t *testing.T) { t.Fatalf("unexpected error %s", err) } - if !cmp.Equal(got, want, equateEmpty, ignoreUnexported) { - t.Error("wrong result:\n", cmp.Diff(got, want, equateEmpty, ignoreUnexported)) + if !cmp.Equal(got, want, equateEmpty, typeComparer) { + t.Error("wrong result:\n", cmp.Diff(got, want, equateEmpty, typeComparer)) } }