Add some generative FsCheck tests for ImmMap #4
+108
−9
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
Property
toProperty(Verbose=True)
and then click output in the visual studio test runner. BothImmMap
andImmSortedMap
pass 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.