Updated tests
Boolean Expectations
import Yarn
func someFunction() throws -> Bool { true } Yarn.expectFunctionToReturnTrue(someFunction) Yarn.expectClosureToReturnFalse { false }
5/9/21, 10:02 AM [yarn.console.log.expectation] ✅: expectFunctionToReturnTrue 5/9/21, 10:02 AM [yarn.console.log.expectation] ❌: expectClosureToReturnFalse
func someThrowingFunction() throws -> Bool { throw Yarn.SomeError.expectedError } Yarn.expectFunctionToThrowAnError(someThrowingFunction)
5/9/21, 10:02 AM [yarn.console.log.expectation] 🚨: expectFunctionToThrowAnError { SomeError(message: "expectedError"): The operation couldn’t be completed. (Yarn.Yarn.SomeError error 1.) }
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Yarn
Boolean Expectations
Usage
Example
Example Output
Example Error
Error Output