Checking multiple partial contracts #397
andrew222651
started this conversation in
General
Replies: 1 comment
|
These are some really nice examples! For what it's worth, this is often the way I use CrossHair! I write little standalone functions with contracts that are essentially just property-based tests. This also reminds me that it's about time to rethink some of how the short-circuiting mechanism is designed. Ideally, the square bracket thing would just be about immutability and not ALSO be a flag for CrossHair techniques like this. 😅 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
An idea that blurs the line between contracts and unit tests:
Alternatively, put test cases in an if statement in the precondition and
postcondition and then contract is public and CrossHair can use the contract for "short-circuiting" contract checking for callers:
All reactions