Introduce proptesting, starting with CheckPoint::range#1397
Merged
evanlinjin merged 1 commit intobitcoindevkit:masterfrom Apr 12, 2024
Merged
Introduce proptesting, starting with CheckPoint::range#1397evanlinjin merged 1 commit intobitcoindevkit:masterfrom
CheckPoint::range#1397evanlinjin merged 1 commit intobitcoindevkit:masterfrom
Conversation
2e72cbc to
c5e5cd0
Compare
LLFourn
reviewed
Apr 5, 2024
LLFourn
approved these changes
Apr 5, 2024
Collaborator
LLFourn
left a comment
There was a problem hiding this comment.
ACK c5e5cd0
LGTM. Also in case you hadn't noticed there is also this tool: https://proptest-rs.github.io/proptest/proptest/state-machine.html
It works very nicely when you have a "model" you want to replicate. So imagine you want to compare your CheckPoint to how a BTreeMap would behave. You generate state transitions and apply them to both and compare them to see if the CheckPoint properly imitates a BTreeMap. Of course you don't need this crate to do it, it's just a structured way of doing it.
Ensure that `CheckPoint::range` returns expected values by comparing against values returned from a primitive approach. I think it is a good idea to start writing proptests for this crate.
a53a959 to
446b045
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is based on #1369. It made sense for me to introduce the
CheckPoint::rangetest as a proptest. I think we should also start introducing it for other methods too.Changelog notice
CheckPoint::range.Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: