# dev dependencies are added to Cargo.toml in the [dev-dependencies] section # These dependencies are not propagated to other packages which depend on # this package. They are used when you need to have a certain # dependency only for tests/benchmarks/examples ect... [dependencies] # your dependencies [dev-dependencies] pretty_assertions = "1" # <--- the dependencies you only need during dev ======================================================================== #[cfg(test)] mod tests { use super::*; use pretty_assertions::assert_eq; // ^------ crate for test-only use. Cannot be used in non-test code. #[test] fn test_fn() { assert_eq!(your_fn(2, 3), 5); } }[package] name = "hello_world" version = "0.1.0" edition = "2021" [dependencies] time = "0.1.12" regex = "0.1.41"