Add some generative FsCheck tests for ImmMap#4
Open
isaksky wants to merge 1 commit intoGregRos:masterfrom
Open
Add some generative FsCheck tests for ImmMap#4isaksky wants to merge 1 commit intoGregRos:masterfrom
isaksky wants to merge 1 commit intoGregRos:masterfrom
Conversation
Owner
|
Thanks. Once I get back to working on the project (not sure when exactly) I'll look into building the existing tests into some kind of framework too. Right now it's all custom. Thanks for the tip about FSharp.Core. I'll have to look into that too. I've written this kind of test code already. You can see it here. The comparison step happens after the tests. I wrap each collection in a wrapper that also performs unit tests after every operation (like checking that |
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.
Hey, not sure if this is useful, or if you already got this covered with other tests, but I made a function to test persistent maps for another project so I thought I'd try on ImmMap too.
It generates a random FSharp.Core.Map, then a random set of actions to do on it (Add | Remove), maintains both an ImmMap and FSharp Map, and then after all the actions are completed, checks that all the intermediate ImmMaps and FSharp Maps are equal.
You can see the input it generates if you change
PropertytoProperty(Verbose=True)and then click output in the visual studio test runner. BothImmMapandImmSortedMappass this test.I had to add some dependencies to the test project, not sure if that is an issue. I also had to drop some references to FSharp.Core to get things to compile on my machine.
If you are open to this kind of thing, I can make some tests for ImmList too.