Add nested anonymous struct test

This commit is contained in:
Lea Anthony
2023-02-25 08:27:36 +11:00
parent cc1a6a3d50
commit 4a8917ecbc
2 changed files with 23 additions and 1 deletions
+19
View File
@@ -884,6 +884,25 @@ func TestParseDirectory(t *testing.T) {
Name: "int",
},
},
{
Name: "Address",
Type: &ParameterType{
Name: "anon2",
IsStruct: true,
Package: "main",
},
},
},
},
"anon2": {
Name: "anon2",
Fields: []*Field{
{
Name: "Street",
Type: &ParameterType{
Name: "string",
},
},
},
},
},
+4 -1
View File
@@ -12,7 +12,10 @@ type Person struct {
Name string
Parent *Person
Details struct {
Age int
Age int
Address struct {
Street string
}
}
}