1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-05 07:40:24 +08:00

New way of marshalling

This commit is contained in:
Gonzalo Fernandez-Victorio
2021-05-11 14:36:48 +01:00
parent ab9b884ff6
commit bb0851ceff
3 changed files with 45 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ func TestStructure(t *testing.T) {
decoded_doc)
}
if len(doc.Body.Paragraphs) != NUM_PARAGRAPHS {
t.Errorf("We expected %d paragraph, we got %d",
t.Errorf("We expected %d paragraphs, we got %d",
NUM_PARAGRAPHS, len(doc.Body.Paragraphs))
}
for _, p := range doc.Body.Paragraphs {
@@ -27,5 +27,10 @@ func TestStructure(t *testing.T) {
t.Errorf("We were not able to parse paragraph %v",
p)
}
for _, child := range p.Children() {
if child.Link == nil && child.Properties == nil && child.Run == nil {
t.Errorf("There are children with all fields nil")
}
}
}
}