示例工程 29-testing-swift-testing

29-testing-swift-testing/Diagnostics/ExpectNeedsBool.swift

swift · 0.2 KB

// 故意编译失败:#expect 需要 Bool,不能传整数。
// 复现:swiftc -typecheck Diagnostics/ExpectNeedsBool.swift
import Testing
 
@Test func expectationNeedsBool() {
    #expect(1 + 1)
}