Skip to content
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

Skip functions with trait reference parameters from selection #83

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

BowTiedRadone
Copy link
Collaborator

@BowTiedRadone BowTiedRadone commented Jan 8, 2025

This PR updates rv by gracefully handling trait references. It skips functions with trait reference parameters from being selected for argument generation and random execution, which previously caused crashes. Currently, trait references are not supported, but this feature is planned (see #65).

Additionally, this PR follows The Boy Scout Rule, leaving the codebase cleaner than it was found. Apparently unrelated updates such as refined arbitrary definitions, refactored comments, and updated logging can be found in this PR.

…ariant testing

This commit introduces a new method called `isTraitReferenceFunction`. Its role
is to recursively check a function's parameters to determine if it includes
trait reference parameters, returning a boolean. Functions containing trait
references are now excluded from the pool of functions available for fuzzing in
invariant testing since trait references are not yet supported. Additionally,
this commit improves the clarity of arbitraries' definitions and adds two unit
tests to validate the new method.
This commit fixes comment inconsistencies in the `shared` file.
This commit excludes functions with trait references from the pool of test
functions available for property testing since trait references are not yet
supported. Additionally, this commit improves the clarity of arbitraries
definitions.
This commit updates logs to display red or green based on run status. It also
modifies trait reference handling to return early instead of throwing an error
in both invariant and property testing.
@BowTiedRadone BowTiedRadone requested a review from a team as a code owner January 8, 2025 00:23
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Makes the overall arbitrary setup cleaner also! Had some comments on the

  • removal of getContractNameFromRendezvousId
  • coverage of isTraitReferenceFunction

app.tests.ts Show resolved Hide resolved
invariant.ts Show resolved Hide resolved
invariant.ts Show resolved Hide resolved
invariant.ts Outdated Show resolved Hide resolved
invariant.ts Show resolved Hide resolved
shared.ts Show resolved Hide resolved
invariant.ts Show resolved Hide resolved
This commit adds a new method, `getContractNameFromContractId`, to replace the
deprecated and removed `getContractNameFromRendezvousId`. The new method is now
used throughout the app wherever needed.
@BowTiedRadone BowTiedRadone force-pushed the fix/skip-trait-references branch from c20f748 to 500aa1a Compare January 8, 2025 14:35
@moodmosaic moodmosaic mentioned this pull request Jan 8, 2025
@BowTiedRadone BowTiedRadone force-pushed the fix/skip-trait-references branch from 0a69753 to 580baaf Compare January 8, 2025 22:42
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 💯

app.ts Show resolved Hide resolved
invariant.ts Show resolved Hide resolved
shared.tests.ts Show resolved Hide resolved
@moodmosaic moodmosaic merged commit d774bf1 into master Jan 9, 2025
21 checks passed
@moodmosaic moodmosaic deleted the fix/skip-trait-references branch January 9, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants