Closed mering closed 2 weeks ago
Students need to see both approaches. Especially in the sandbox, the running a binary crate is pretty common and useful as it shows the output.
As you've observed, #[test]
is used in the second exercise, and I think that's close enough to the beginning of the course to highlight both approaches.
Ah, and I just remembered #1581 which would at least make this consistent. That's assigned to me but I'd be happy to reassign if you're willing to work on it!
Using cargo's first class testing support is so much nicer than manually
cargo run
all the time during development. People should get used to writing tests instead of manually writing binaries for testing their code right from the beginning. Luckily it is introduced for the second exercise (Collatz length).