-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add discard functionality for conditional tests #40
Conversation
This commit introduces an example of a Clarity preliminary function designed to pair with a conditional property test. It also includes a comment outlining the rules for structuring preliminary functions, covering their requirements.
This commit updates the conditional property test function by replacing its early return condition with a call to the corresponding preliminary function. This change clarifies the role of preliminary functions in validating input before executing the main test logic.
This commit adds checks for preliminary functions to ensure they follow the rules. It checks that the parameters match those of the test functions and that the return type is a boolean.
This commit adds the preliminary function run before the test function and stores the result.
Made some optional/stylish tweaks here. Can be tested with:
Here is an alternative one: |
Perhaps dim the generated args for discarded tests and that’s it. No need to even print (discarded) at all. |
This commit adds conditional logic to property testing based on preliminary functions' response. Property tests with a preliminary function won’t need an initial condition. The updated `test-slice-list-int` demonstrates this new setup. This commit also includes a minor indentation fix.
Co-authored-by: Nikos Baxevanis <[email protected]>
This commit updates the `ansicolors` used for property testing logging. Thanks to @moodmosaic for this great proposal: 3adcfe4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a high-level review. Have to decide on the DSL (is it can-
, discard-
, preliminary
?). Can't mix and match those terms as they are core terminology for RV.
Co-authored-by: Nikos Baxevanis <[email protected]>
Co-authored-by: Nikos Baxevanis <[email protected]>
Co-authored-by: Nikos Baxevanis <[email protected]>
Co-authored-by: Nikos Baxevanis <[email protected]>
Thanks to @moodmosaic for the great suggestion in https://github.com/stacks-network/rendezvous/pull/40/files#r1830543508.
f9a6c51
to
3d12d0b
Compare
This commit adds tests for `isParamsMatch` and `isReturnTypeBoolean`.
b45f1b4
to
7eabfaf
Compare
If there are discarded tests, output is green and yellow but the result still shows as green. Better to leave it uncolored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Massive! Final touches added and ready to go.
Excited to use this for sBTC invariant/property-based fuzzing, expanding on
what we achieved with PoX-4 fuzzing techniques.
This PR adds logic to
discard
property tests that don't meet certain preconditions. It partially addresses #38.Sample output
When a test is discarded, it is now highlighted with a
[WARN]
and dimmed function arguments: