1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-11 02:50:27 +08:00

Keep unmarshalling

This commit is contained in:
Gonzalo Fernandez-Victorio
2021-05-11 16:17:06 +01:00
parent af18d96b6b
commit 965e28ba05
4 changed files with 89 additions and 9 deletions

View File

@@ -29,11 +29,17 @@ func TestStructure(t *testing.T) {
}
for _, child := range p.Children() {
if child.Link == nil && child.Properties == nil && child.Run == nil {
t.Errorf("There are children with all fields nil")
t.Errorf("There are Paragraph children with all fields nil")
}
if child.Run != nil && child.Run.Text == nil {
t.Errorf("We have a run with no text")
}
if child.Run != nil && child.Run.Text != nil && child.Run.Text.Text == "" {
t.Errorf("We have a text with no text")
}
if child.Link != nil && child.Link.ID == "" {
t.Errorf("We have a link without ID")
}
}
}
}