Need Assistance?

support@tutorialshub.in

Modules, Testing & Cargo Ecosystem

Writing Tests (#[test] & cargo test)

ADVERTISEMENT
Rust Free Lesson
5 min read
ADVERTISEMENT

Rust has a built-in test runner! Place unit tests right inside a #[cfg(test)] mod tests block at the bottom of your file, mark test functions with #[test], and run cargo test.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you