diff --git a/internal/reflect/helpers_test.go b/internal/reflect/helpers_test.go index 25a38721..43a21e49 100644 --- a/internal/reflect/helpers_test.go +++ b/internal/reflect/helpers_test.go @@ -134,6 +134,12 @@ func TestGetStructTags(t *testing.T) { "field5": {1}, }, }, + "embedded-struct-err-cannot-have-tfsdk-tag": { + in: struct { + ExampleStruct `tfsdk:"example_field"` // Can't put a tfsdk tag here + }{}, + expectedErr: errors.New(`example_field: embedded struct field ExampleStruct cannot have tfsdk tag`), + }, "embedded-struct-err-invalid": { in: struct { StructWithInvalidTag // Contains an invalid "tfsdk" tag @@ -179,6 +185,12 @@ func TestGetStructTags(t *testing.T) { "field5": {1}, }, }, + "embedded-struct-ptr-err-cannot-have-tfsdk-tag": { + in: struct { + *ExampleStruct `tfsdk:"example_field"` // Can't put a tfsdk tag here + }{}, + expectedErr: errors.New(`example_field: embedded struct field ExampleStruct cannot have tfsdk tag`), + }, "embedded-struct-ptr-err-duplicate-fields": { in: struct { *EmbedWithDuplicates