I just learned about testing my code in the doc. But I can't make it work.
I have a
lib.rs file and a lot of modules under it in other rust files. When I add a code block with assert_eq! in one of these files, let's call it
foo.rs, I run the command
cargo rustdoc --test foo.rs --open
However this will give me an error message no test target named 'foo.rs' found.
As I understand the docs this should work and also I should add every test to the command line. The command gets pretty big then.
Is there a way to tell rust to just test everything in all documentation?