Skip to content
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

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

Open
halloleo opened this issue Jun 2, 2023 · 2 comments

Comments

@halloleo
Copy link

halloleo commented Jun 2, 2023

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
Copy link
Owner

sol commented Jun 3, 2023

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
Copy link
Author

halloleo commented Jun 3, 2023

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants