示例工程 29-testing-swift-testing

29-testing-swift-testing/Diagnostics/README.md

markdown · 0.4 KB

# Diagnostics
 
三个文件**故意编译失败**,用来复现第 29 章「报错现场」的真实诊断。
 
```bash
swiftc -typecheck Diagnostics/ExpectNeedsBool.swift       # error: type 'Int' cannot be used as a boolean
swiftc -typecheck Diagnostics/TestOnProperty.swift        # error: Attribute 'Test' cannot be applied to a property
swiftc -typecheck Diagnostics/RequireInNonThrowing.swift  # error: errors thrown from here are not handled
```