Tests seem to run for both lib and main
tomadimitrie opened this issue · comments
Dimitrie-Toma Furdui commented
Hi, I am following the blog, currently at the tests post. The tests seem to run twice:
Running unittests src/lib.rs (target/target/debug/deps/os-700045f9d1cee9a8)
...
Running unittests src/main.rs (target/target/debug/deps/os-72fe698e079ceb87)
Both files call test_main
so the tests run twice. Any idea why? I compared my code with the post-04 branch and seems to be the same.
Thank you! Awesome work btw :)
Philipp Oppermann commented
That's how testing in Rust works. Libraries are built and tested separately from binaries.
Dimitrie-Toma Furdui commented
Thanks!