feat: Working on node builder
This commit is contained in:
@@ -96,6 +96,23 @@ final class CliDocTests: XCTestCase {
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testLabeledContent2() {
|
||||
let node = LabeledContent2 {
|
||||
"Foo"
|
||||
} content: {
|
||||
Text("Bar")
|
||||
}
|
||||
// .labelStyle(.green)
|
||||
// .labelStyle(.bold)
|
||||
|
||||
let expected = """
|
||||
Foo Bar
|
||||
"""
|
||||
XCTAssert(node.render() == expected)
|
||||
print(type(of: node.body))
|
||||
XCTAssertNotNil(node.body as? _ManyNode)
|
||||
}
|
||||
|
||||
func testShellCommand() {
|
||||
let node = ShellCommand {
|
||||
"ls -lah"
|
||||
@@ -126,4 +143,14 @@ final class CliDocTests: XCTestCase {
|
||||
let foo = Foo()
|
||||
XCTAssertNotNil(foo.body as? LabeledContent)
|
||||
}
|
||||
|
||||
func testGroup2() {
|
||||
let node = Group2 {
|
||||
Text("foo")
|
||||
Text("bar")
|
||||
}
|
||||
print(node.render())
|
||||
XCTAssertNotNil(node.body as? _ManyNode)
|
||||
// XCTAssert(false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user