Swiftpack.co - StanfordBDHG/XCTRuntimeAssertions as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by StanfordBDHG.
StanfordBDHG/XCTRuntimeAssertions 0.2.3
XCTest extensions to test runtime assertions and preconditions
⭐️ 1
🕓 1 week ago
.package(url: "https://github.com/StanfordBDHG/XCTRuntimeAssertions.git", from: "0.2.3")


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 {

XCTRuntimePrecondition for catching preconditions:

try XCTRuntimePrecondition {

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.

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


Stars: 1
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1 week ago

What's Changed

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