ssadler / hawk

Awk for Hoodlums
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

doctest #32

Open gelisam opened 11 years ago

gelisam commented 11 years ago

Hspec is so much more verbose than doctest, the least annoying unit testing library I know of. I suggest we switch.

melrief commented 11 years ago

I'm not a big fan of putting examples in the source code documentation and mix examples with tests. That's why I usually create tests in another directory.

gelisam commented 11 years ago

Maybe we can have a bit of both? If we use hspec, I know I am probably not going to add any test to the testsuite.

melrief commented 11 years ago

+1

We are probably going to put examples in function documentations, so doctest is perfect for checking those examples against the implementation. With doctest we don't have to check them manually everytime we change something. So I'm ok with doctest. But for extensible tests, I would like a separate directory with tests that convers many cases. Hspecs is what I was using, but I'm open to new ideas of course.

I checked the tests that I did for Representable.hs. Probably doctests is better than Hspecs for those tests because they are usage examples and it can be handy to have them above the function definition. I want to know more about this test suite.