Basic file hierarchy under src:
src
|-- tests | |-- my_test.rs | |-- mod.rs `-- lib.rs
src/lib.rs:
src/lib.rs
mod tests;
src/tests/mod.rs:
src/tests/mod.rs
mod my_test;
src/tests/my_test.rs:
src/tests/my_test.rs
.
#[test] fn it_works() { assert_eq!(2 + 2, 4); }
Running the tests:
cargo test --lib
There was an error while loading. Please reload this page.