WIP: First draft of testPropertyIO. Needs refactor before merge#62
Open
voidus wants to merge 1 commit intowell-typed:mainfrom
Open
WIP: First draft of testPropertyIO. Needs refactor before merge#62voidus wants to merge 1 commit intowell-typed:mainfrom
voidus wants to merge 1 commit intowell-typed:mainfrom
Conversation
It works, but it's super ugly (and I messed up the demo to get a proof of concept)
Collaborator
|
I have limited time at the moment (well, actually, always..) but if you feel this this is ready for me to take a look, let me know :) |
Collaborator
|
Marked this as WIP. Feel free to ping me when you think this is ready for review :) |
Open
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.
Very ugly proof of concept to address #57
This is a huge mess of copy/paste/mess-with, but it seems to work and I wanted to share it.
I definitely want to look into making
assert(or maybe a new similar function) work in IO so we can get the same rich predicates that we're used to.I think wrapping the predicate result in a custom exception and handling that specifically is probably possible. We could also add a type class so we can use
assertboth inIOandProperty, but I'm not sure if that's actually a good idea yet.The type of
testPropertyIOisTestName -> Property (IO ()) -> TestTree, which forces the property into a two-phase model. Once we've entered IO-land, we can't use generators anymore.test:
output: