Extra test case catching edge case from using integer division

In the need-for-speed exercise I noticed the test cases don’t catch errors in the implementation that are the result of integer division rounding down to a natural number. While checking out some of the alternative solutions when working through the exercise I realised the top answers are actually defective.

I submitted a PR but it was auto closed. You can find it here:

Maybe a maintainer is willing to consider the PR since it is such a small change.

This PR introduces a test that should force students into considering these edge cases. Note that learning about integer division is a prerequisite to reaching this exercise.

1 Like