- Hands-On Server-Side Web Development with Swift
- Angus Yeung
- 58字
- 2021-06-10 19:00:20
Learning useful assertion macros
Swift test assertions are useful in checking expected results in test methods. There is a family of macros similar to XCTAssert() to help evaluate any given conditions. Each macro optionally allows a literal NSString to describe what happens when there is a failure. For XCTAssert(), a failure is when the Boolean expression == false: