Closed chshersh closed 5 years ago
This is interesting. Would love to help here. I will try it out. Might ask for help as I usually skip tests. ;-(
Oops - sorry it seems like someone else is already assigned to this. Please ping me if this issue frees up.
@StevenXL I just saw this. I have no experience with writing tests, so if you do, I would gladly learn from you if you would like to have a go at it. Let me know 👍
@kahlil29 I will try - if I run into problems, maybe we can pair on this at some point. Will write you an updated by this Friday (I'm in U.S. Central time).
@chshersh
To be clear, this ticket has to be implemented with hspec
and quickcheck
?
I was reading up some basic tutorials about hspec
and it seems like they are stating desired behaviour and examples with hspec
and then using quickcheck
to generate and run the tests on random data sets. Correct me if I understood something wrong or if you have another way of going about this ticket.
@kahlil29 I can see why there is some confusion about testing libraries. In Haskell there exist at least two paradigms for testing:
QuickCheck
is a library for property testing (there are at least 5 different libraries for property testing). hedgehog
is another library for property testing, and in our projects we use hedgehog
.
hspec
is a library for unit testing. However, since QuickCheck
is a trendy library, hspec
implemented smooth integration with QuickCheck
. That's why you can use quickcheck-style property tests when using hspec
.
This issue doesn't require to implement any property tests because we don't have properties for the function. Only a bunch unit tests for different cases. That's why it's enough to use only hspec
.
@chshersh Thanks for your patient and detailed, yet concise explanation of the types of testing and the different libraries involved. It really helped my understanding and made the implementation easier for me to do.
This function:
https://github.com/kowainik/hit-on/blob/4f8d392967675f535232ec9d407dae227f1bcf73/src/Hit/Issue.hs#L98
It would be nice to have several tests with the
hspec
library.