Add repeat for parametrized tests and fuzz test examples - #259
Conversation
|
Very interesting! One thing I would change is the order of arguments for -- Currently
testWith
"""Multi
line
piece
of
data
"""
"only whitespace"
-- Suggested
testWith "only whitespace"
"""Multi
line
piece
of
data
""" |
|
Yep, I would also like it the other way. But I followed the Maybe it’s better to do |
|
I agree about the arguments for the fuzz function being out of order. That said, the title remains near the top in the usual (non- For |
I’m not quite following here. Do you have an example? |
|
What I meant is that when defining a fuzz test such as fuzz
myFuzzer
"title"
<|
\data -> ...the title is still "near" the top of the test definition. Not as high as it could be ( |
|
Btw, is it confusing that |
|
Right, that's a good point. |
Btw, I found an issue about this: #97 |
This PR adds a small convenience function called
repeat(and one calledtestWith, which istestbut shaped to fitrepeat). This does not unlock anything that wasn’t already possible in user land – it’s all about convenience and teaching.Me and @Janiczek were chatting, and Martin mentioned that when a fuzz test failed, he was missing a convenient way of adding that case as a regression test.
repeatto the rescue!What I really like about this solution (and that I haven’t seen in ad-hoc implementations of this in test suites):
skipandonly. No commenting out stuff in the list!test,fuzz,describeetc.), whereas user land functions don’t really have that possibility.