feat: Adds extension to argument parser's command configuration

This commit is contained in:
2024-12-07 09:20:02 -05:00
parent 1a559e0236
commit 45ab7ca578
13 changed files with 250 additions and 5 deletions

View File

@@ -86,11 +86,30 @@ struct CliDocCoreTests {
#expect(array.render() == "foo bar")
}
@Test
func testLabeledContent() {
let horizontal = LabeledContent {
"Content"
} label: {
"Label:".color(.yellow).bold()
}
let expected = """
\("Label:".yellow.bold) Content
"""
#expect(horizontal.render() == expected)
#expect(horizontal.style(.vertical()).render() == """
\("Label:".yellow.bold)
Content
""")
}
@Test(arguments: [
Style.bold, .italic, .dim, .underline, .blink, .strikethrough
])
func testTextStyles(style: Style) {
let node = Group { "foo" }.textStyle(StyledText(style))
let node = Group { "foo" }.textStyle(_StyledText(style))
let string = "foo".applyingStyle(style)
#expect(node.render() == string)
}