I'm writing a Rust library and I want to provide examples in my documentation that
- compile as part of running
cargo test
- do not run.
Is this possible?
I'm writing a database client library, and the examples make use of a hypothetical, non-existing database server. As such, the examples always fail when run, but it's important that the examples be valid syntactically. Hence my requirements above.
If there's no way to do what I want, then how does one opt out of having cargo test
run a specific doc test? I.e., have cargo run
compile-and-run some doc tests but completely ignore some others?