I'm trying to practice rust using exercism
one of problem set has a test file like this

when i tried to run Cargo test, its not recognizing the crate name.I tried different variations difference-of-squares,"difference-of-squares" with no success.
contents of Cargo.toml

edit: I tried with both stable release and the current nightly.
You're likely using an old version of Cargo. Previously, crates-with-hyphens were allowed, but horrible to use:
extern crate "difference-of-squares" as squares;
At some point in the past, Cargo was changed to basically not allow them; it just converted all hyphens to underscores so you didn't have to manually rename every crate that had hyphens in its name, every time you used it.
You haven't specified what version you're using, but updating to the latest release (Rust 1.2 just got released will be released in a few days) should fix it. Failing that, try quoting the literal name of the crate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With