pull from main
This commit is contained in:
34
Tests/CliDocTests/CliDoc2Tests.swift
Normal file
34
Tests/CliDocTests/CliDoc2Tests.swift
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
@testable import CliDoc2
|
||||||
|
@preconcurrency import Rainbow
|
||||||
|
import Testing
|
||||||
|
|
||||||
|
let setupRainbow: Bool = {
|
||||||
|
Rainbow.enabled = true
|
||||||
|
Rainbow.outputTarget = .console
|
||||||
|
return true
|
||||||
|
}()
|
||||||
|
|
||||||
|
@Test
|
||||||
|
func testGroup() {
|
||||||
|
#expect(setupRainbow)
|
||||||
|
let group = Group {
|
||||||
|
Label { "Foo:" }
|
||||||
|
"Bar"
|
||||||
|
"Baz"
|
||||||
|
Note { "Bang:" } content: { "boom" }
|
||||||
|
if setupRainbow {
|
||||||
|
Label("Hello, rainbow").color(.blue)
|
||||||
|
} else {
|
||||||
|
Label("No color for you!").color(.red)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.color(.green)
|
||||||
|
.style(.italic)
|
||||||
|
|
||||||
|
print(type(of: group))
|
||||||
|
print(group.render())
|
||||||
|
|
||||||
|
// let note = Note { "Bang:" } content: { "boom" }
|
||||||
|
// print(note.render())
|
||||||
|
// print(type(of: note.label))
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user