Skip to content

Commit 5ac153c

Browse files
committed
tag builder tests
1 parent a6d3856 commit 5ac153c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Tests/SwiftSgmlTests/TagBuilderTests.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,40 @@ final class TagBuilderTests: XCTestCase {
107107
""")
108108
}
109109

110+
func testSingleGroupBuilder() {
111+
let doc = Document {
112+
Branch {
113+
[
114+
Leaf("Lorem ipsum")
115+
]
116+
}
117+
}
118+
119+
XCTAssertEqual(DocumentRenderer().render(doc), """
120+
<branch>
121+
<leaf>Lorem ipsum</leaf>
122+
</branch>
123+
""")
124+
}
125+
126+
func testMultiGroupBuilder() {
127+
let doc = Document {
128+
Branch {
129+
[
130+
Leaf("Lorem ipsum"),
131+
Leaf("Dolor sit amet"),
132+
]
133+
}
134+
}
135+
136+
XCTAssertEqual(DocumentRenderer().render(doc), """
137+
<branch>
138+
<leaf>Lorem ipsum</leaf>
139+
<leaf>Dolor sit amet</leaf>
140+
</branch>
141+
""")
142+
}
143+
110144
func testGroupTagBuilderAndRenderer() {
111145
let doc = Document {
112146
Branch {

0 commit comments

Comments
 (0)