Skip to content

Commit

Permalink
Update continuation unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
beevik committed Jan 21, 2025
1 parent fd97f04 commit f6baac9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,7 @@ func TestContinuations(t *testing.T) {
doc := NewDocument()
root := doc.CreateElementContinue("root", func(e *Element) {
e.CreateElementContinue("child1", func(e *Element) {
e.CreateComment("Grandchildren of child #1")
e.CreateElementContinue("grandchild1", func(e *Element) {
e.CreateAttr("attr1", "1")
e.CreateAttr("attr2", "2")
Expand All @@ -1644,6 +1645,7 @@ func TestContinuations(t *testing.T) {
})
})
e.CreateElementContinue("child2", func(e *Element) {
e.CreateComment("Grandchildren of child #2")
e.CreateElementContinue("grandchild1", func(e *Element) {
e.CreateAttr("attr1", "5")
e.CreateAttr("attr2", "6")
Expand All @@ -1666,10 +1668,12 @@ func TestContinuations(t *testing.T) {
// Make sure the serialized XML matches expectation.
expected := `<root>
<child1>
<!--Grandchildren of child #1-->
<grandchild1 attr1="1" attr2="2"/>
<grandchild2 attr1="3" attr2="4"/>
</child1>
<child2>
<!--Grandchildren of child #2-->
<grandchild1 attr1="5" attr2="6"/>
<grandchild2 attr1="7" attr2="8"/>
</child2>
Expand Down

0 comments on commit f6baac9

Please sign in to comment.