-
Notifications
You must be signed in to change notification settings - Fork 107
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 a runTests function #168
Conversation
hedgehog/test/test.hs
Outdated
Test.Hedgehog.Text.tests | ||
main = | ||
runTests | ||
[ Test.Hedgehog.Text.tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to keep the same syntax style here, start of list on previous line that is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Fixed the formatting in the comment for runTests
as well.
fbdf826
to
adbc425
Compare
I feel a bit weird exporting a function that calls (not requesting changes per se, just wondering how you two feel about it) |
I'm not married to the name, I just don't want to have to redefine this function in every test suite I write. I also think what you said makes a lot of sense. So how about:
|
Hmm, now that I think about it, I'm mot so sure about the last part. I could imagine wanting to do:
|
Hmm... Isn't this a little bit weird? Perhaps it could be exposed as 'internal' from Hedgehog itself so we keep importing only the essential stuff: import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range |
The idea of putting this in a separate
|
Are we 100% sure about the |
@moodmosaic The import you have in your example are the ones you would put in an actual test suite. I usually keep actual tests out of the top level test runner. With this new functionality, my top level test runner would look like:
I'm not married to the name Update: I think the new naming and type signatures are specific enough for these to be exported from Update 2: Exposing |
I don't like the name Hedgehog.Main, but Run or Runner I could get behind. It just feels a bit wrong to me for a library (not an executable) to export a module called Main. I would prefer that this be exported from Hedgehog rather than a separate module regardless. My preference is the version that calls |
This is why my (strawman) proposal now has three versions of the runner function :). |
-- | ||
-- Given a number of separate modules all defining test funtion named `tests`, | ||
-- the individual module level tests can be collected together and run in | ||
-- sequence (one module of tests at a time) and the funcion will will exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: there seems to be an extra space between sequence
.
Nitpick: will
occurs two times in a row on that sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this PR will not go ahead as it is anyway.
86a8ac0
to
e5f6fab
Compare
Closing this based on Slack discussions we had back in March. The decision was to not rush into exporting a top-level runner, since public exports are forever and we all had some reservations about the current design. There is also the question of terminal encoding, Windows, etc to consider. |
e5f6fab
to
3a8daa9
Compare
And actually use one in the Hedhehog tests. Closes: hedgehogqa#97
3a8daa9
to
e5631be
Compare
💯 |
And actually use it in the Hedhehog tests.
Closes: #97
@thumphries @jystic @nhibberd