Skip to content

Commit

Permalink
tag builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Mar 10, 2022
1 parent a6d3856 commit 5ac153c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tests/SwiftSgmlTests/TagBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,40 @@ final class TagBuilderTests: XCTestCase {
""")
}

func testSingleGroupBuilder() {
let doc = Document {
Branch {
[
Leaf("Lorem ipsum")
]
}
}

XCTAssertEqual(DocumentRenderer().render(doc), """
<branch>
<leaf>Lorem ipsum</leaf>
</branch>
""")
}

func testMultiGroupBuilder() {
let doc = Document {
Branch {
[
Leaf("Lorem ipsum"),
Leaf("Dolor sit amet"),
]
}
}

XCTAssertEqual(DocumentRenderer().render(doc), """
<branch>
<leaf>Lorem ipsum</leaf>
<leaf>Dolor sit amet</leaf>
</branch>
""")
}

func testGroupTagBuilderAndRenderer() {
let doc = Document {
Branch {
Expand Down

0 comments on commit 5ac153c

Please sign in to comment.