sol / doctest

An implementation of Python's doctest for Haskell
https://hackage.haskell.org/package/doctest
MIT License
372 stars 72 forks source link

Can I focus doctest on a particular function in a module or can I exclude functions from being tested? #403

Open halloleo opened 1 year ago

halloleo commented 1 year ago

When I develop a module with a bunch of functions and I am working on one function I don't necessarily want to always test all functions in that module. -- Is there a way to narrow doctest to a particular functions in a module?

Or -- the other way around -- can I exclude functions from being tested?

sol commented 1 year ago

I think it is currently not possible.

NB:

doctest is a tool for testing documentation. doctest make sure that examples in your documentation do actually work.

doctest is not suitable for testing code. If you want to test code then hspec will give you a much more pleasant experience.

hspec is much faster thandoctest. hspec also allows you to focus on individual tests with focus, fit, and fdescribe.

halloleo commented 1 year ago

Thanks for this info. Makes sense.

I'm just learning Haskell and in our course we use doctest as the "testing framework". When I'm "libearting" from the course, is hspec the framework in Haskell? I thought QuickCheck is the one...