目录
目录README.md

XCTRuntimeAssertions

Build and Test codecov DOI

XCTRuntimeAssertions allows developers to test assertions and preconditions in tests using XCTest.

How To Use XCTRuntimeAssertions

You can use XCTestExtensions in your tests. The API documentation provides a detailed overview of the public interface of XCTestExtensions.

  1. Import XCTRuntimeAssertions to your system under test and call the assert and precondition functions that are defined in the XCTRuntimeAssertions Swift package. They provide the same functionality and parameters as the assert and precondition functions in the Swift Standard Library.

  2. Use the XCTRuntimeAssertion and XCTRuntimePrecondition global functions to write unit tests that expect an assert and precondition and use the additional parameters to further refine and specify your assertions:

XCTRuntimeAssertion for catching assertions:

try XCTRuntimeAssertion {
 assertionFailure()
}

XCTRuntimePrecondition for catching preconditions:

try XCTRuntimePrecondition {
 preconditionFailure()
}

For more information, please refer to the API documentation.

Contributing

Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.

License

This project is licensed under the MIT License. See Licenses for more information.

Stanford Byers Center for Biodesign Logo Stanford Byers Center for Biodesign Logo

关于
79.0 KB
邀请码