25 lines
829 B
Swift
25 lines
829 B
Swift
import Testing
|
|
@_spi(Portico) import Portico
|
|
|
|
@Suite struct WindowConfigTests {
|
|
@Test func modifiersAccumulate() {
|
|
let w = ApplicationWindow { _ in Label(str: "x") }
|
|
.title("T")
|
|
.defaultSize(width: 100, height: 200)
|
|
.resizable(false)
|
|
.fullscreen()
|
|
#expect(w.config.title == "T")
|
|
#expect(w.config.defaultSize?.width == 100)
|
|
#expect(w.config.defaultSize?.height == 200)
|
|
#expect(w.config.resizable == false)
|
|
#expect(w.config.fullscreen == true)
|
|
}
|
|
|
|
@Test func defaultConfigIsEmpty() {
|
|
let w = ApplicationWindow { _ in Label(str: "x") }
|
|
#expect(w.config.title == nil)
|
|
#expect(w.config.defaultSize == nil)
|
|
#expect(w.config.resizable == nil)
|
|
#expect(w.config.fullscreen == false)
|
|
}
|
|
}
|