Hands-On Server-Side Web Development with Swift
上QQ阅读APP看书,第一时间看更新

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: