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

Add property testing for Felt bit shifts #701

Merged
merged 11 commits into from
Jan 12, 2023

Conversation

martinacantaro
Copy link
Contributor

@martinacantaro martinacantaro commented Jan 9, 2023

Add property testing for Felt bit shifts

Description

Property-based test that ensures, for 100 values that are randomly generated each time tests are run, that performing a bit shift to the left or to the right by shift_amount of bits (between 0 and 999) returns a result that is inside of the range [0, p].

Checklist

@martinacantaro martinacantaro changed the title add property testing for left bit shift add property testing for Felt bit shifts Jan 9, 2023
@igaray
Copy link
Collaborator

igaray commented Jan 9, 2023

Tests look good! but one thing I see consistently missing is comments on tests indicating motivation, what the tests wants to check, and not how it does it. This improves both understanding for newcomers, modification of the tests in the future, and most importantly, debugging when someone else makes them fail.
The PR description could be expanded and included in the corresponding tests.

@martinacantaro
Copy link
Contributor Author

Agree! Will make the required changes

@martinacantaro
Copy link
Contributor Author

Added comments to each test.

Please don't merge because I also want to check if a particular change to the tests is needed

@martinacantaro
Copy link
Contributor Author

All done! The change wasn't necessary

Copy link
Contributor

@Juan-M-V Juan-M-V left a comment

Choose a reason for hiding this comment

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

Great work!

@martinacantaro martinacantaro changed the title add property testing for Felt bit shifts [WIP - Solving conflicts] add property testing for Felt bit shifts Jan 12, 2023
@martinacantaro martinacantaro changed the title [WIP - Solving conflicts] add property testing for Felt bit shifts Add property testing for Felt bit shifts Jan 12, 2023
@martinacantaro martinacantaro merged commit 874e6e0 into main Jan 12, 2023
@martinacantaro martinacantaro deleted the add-bit-shift-proptests-for-felt branch January 12, 2023 21:57
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.

5 participants