Rust 46 🦀 Writing Automated Unit Tests and Documentation Tests
Rust treats testing as a first-class part of the language. The cargo test command is built into the toolchain, the test functions are ordinary functions annotated with the #[test] attribute, and the test module is the ordinary module with the #[cfg(test)] attribute. There is no separate test framework to install, no configuration file to write,…