mirror of
https://github.com/apple/swift.git
synced 2025-12-25 12:15:36 +01:00
30 lines
592 B
Swift
30 lines
592 B
Swift
// RUN: %target-run-simple-swift
|
|
// REQUIRES: executable_test
|
|
|
|
import StdlibUnittest
|
|
|
|
|
|
let PrintTests = TestSuite("PrintBoolean")
|
|
|
|
PrintTests.test("CustomStringConvertible") {
|
|
func hasDescription(_ any: Any) {
|
|
expectTrue(any is CustomStringConvertible)
|
|
}
|
|
|
|
hasDescription(Bool(true))
|
|
hasDescription(CBool(true))
|
|
}
|
|
|
|
PrintTests.test("Printable") {
|
|
expectPrinted("true", CBool(true))
|
|
expectPrinted("false", CBool(false))
|
|
|
|
expectPrinted("true", Bool(true))
|
|
expectPrinted("false", Bool(false))
|
|
|
|
expectPrinted("true", true)
|
|
expectPrinted("false", false)
|
|
}
|
|
|
|
runAllTests()
|