-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Documentation should make it clear where to put doctest!
#25
Comments
This seems highly surprising. You can see the source code of the macro here. So I think the issue lies outside of this crate at this point... |
Alright, I've created a minimal repo to reproduce here: https://github.com/robinst/test-doc-comment Can you clone and run My Rust version is 1.47.0 if that matters. |
I just realized: you need to add |
Doesn't help: robinst/test-doc-comment@8ac8c8f Note, adding this to
So I think the problem is that doctests in integration tests are not run at all. It just needs to be documented. |
Ah ok! Now I get your issue. Yes, |
Done: https://github.com/rust-lang/rust/issues/79587 But also, I think the docs for this crate (doc-comment) should mention it as well. |
I was adding this crate to my library like this:
tests/readme.rs
:And I added an error into the code in README to see if it would fail. But
cargo test
succeeded.What actually worked was adding this to
src/lib.rs
instead:It would be good if the documentation made it very clear where to add the code. Or was I missing something else?
The text was updated successfully, but these errors were encountered: