Answer the question
In order to leave comments, you need to log in
Rust nested crate, how to run tests?
There is the following structure:
Crate in Cargo.toml is connected like this:
[dependencies]
reverse = { path = "reverse" }
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}
Answer the question
In order to leave comments, you need to log in
Why: because the crate was added as just a dependency, albeit a local one.
Fix: Add reverse to workspace: https://doc.rust-lang.org/book/ch14-03-cargo-works...
[workspace]
members = ["reverse"]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question