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

Proptest for define functions #476

Merged
merged 3 commits into from
Aug 19, 2024
Merged

Proptest for define functions #476

merged 3 commits into from
Aug 19, 2024

Conversation

matteojug
Copy link
Contributor

@matteojug matteojug commented Aug 16, 2024

This PR adds some basic proptests for define-(public|private|read-only) (#289).

There are 4 tests repeated for the three functions (with small variations):

  • Define a fn accepting random args, returns another random value
  • Define a fn accepting random args, returns one of the args
  • Define a fn accepting random args, returns a tuple using all the args
  • Define a fn accepting random args, do a var-set and return a random response (excluding define-read-only)

While writing this I encountered two issues (#473, #475) that could inspire some more proptests (random fn/arg names, adding more ops in the fn body to mess interact with the stack); please let me know if you want to add those or some other test.

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.87%. Comparing base (95e2b63) to head (3c00cae).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #476   +/-   ##
=======================================
  Coverage   85.87%   85.87%           
=======================================
  Files          44       44           
  Lines       19995    19995           
  Branches    19995    19995           
=======================================
  Hits        17170    17170           
  Misses       1324     1324           
  Partials     1501     1501           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Acaccia Acaccia left a comment

Choose a reason for hiding this comment

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

Looks great, just a small typo

clar2wasm/tests/wasm-generation/functions.rs Outdated Show resolved Hide resolved
@matteojug matteojug added this pull request to the merge queue Aug 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 19, 2024
@matteojug
Copy link
Contributor Author

Re-adding to merge queue: the proptest error (values::constant_define_and_get) seems the same issue as #452

@matteojug matteojug added this pull request to the merge queue Aug 19, 2024
Merged via the queue into main with commit 368e1d4 Aug 19, 2024
10 checks passed
@matteojug matteojug deleted the test/proptest-define-fns branch August 19, 2024 11:50
@Acaccia
Copy link
Collaborator

Acaccia commented Aug 19, 2024

It's actually due to this one: stacks-network/stacks-core#4622
Can't wait for it to be fixed :(

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