Cargo not running tests in top-level file

Viewed 7686

I'm quite confused by how Cargo finds tests to run.

I've created a Cargo project and it added a main.rs for me. If I add #[test] functions in there, they're found and run with cargo test. If I add a foo.rs file as a sibling to main.rs and add tests in there, they're not found and run.

What subtlety am I missing? Do I somehow have to teach Cargo about new files?

1 Answers
Related