XCTRuntimeAssertions allows developers to test assertions and preconditions in tests using XCTest.
You can use XCTestExtensions in your tests. The API documentation provides a detailed overview of the public interface of XCTestExtensions.
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.
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.
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
This project is licensed under the MIT License. See Licenses for more information.
link |
Stars: 1 |
Last commit: 1 week ago |
Full Changelog: https://github.com/StanfordBDHG/XCTRuntimeAssertions/compare/0.2.2...0.2.3
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics