Please add todo!() to the solution setup so it compiles as-is
Since your custom assertion messages already contain all the necessary information, using assert_eq is redundantly noisy. You could switch it out for assert!(actual == expected, /* msg */) for more concise test output.
According to the docs using array.map is inefficient, especially if all you want is to unpack the resulting collection. You could alternatively do something like this:
useitertools::Itertools;
/* snip */// Ignore the panic, it will never trigger, but allows to refutably match on `Some`.letSome((a, b, c)) = (0..3).map(|_| rng.gen_range(-100..=100)).collect_tuple() else {panic!()};
In future translations, leave the comment at the top of Sample Tests (not submission tests) that explains to users how to add tests of their own in place, it's informative especially for beginner-level kata.
approved
Fixed :)
todo!()
to the solution setup so it compiles as-isassert_eq
is redundantly noisy. You could switch it out forassert!(actual == expected, /* msg */)
for more concise test output.array.map
is inefficient, especially if all you want is to unpack the resulting collection. You could alternatively do something like this:Cheers
You're supposed to check if there are exactly two positive numbers.
Please read the description. It's one line; you should be able to do that.
That test is correct.
"twoArePositive": Test case is buged returning:
(4, 6, 10): expected true to equal false
Clearly all numbers are positive but they expect false please correct the wrong test case.
Please read the description.
Why 4 6 10 == false?!
Rust translation
This comment is hidden because it contains spoiler information about the solution