Feat: add negative midnight test case for clock exercise

The test did not include situations where the final hours are equal to -24 and the minutes are equal to 0. This situation should also return 00:00. I added the test case {-24, 0, "00:00", "negative midnight is zero hours"} to ensure this is now checked. Both 24:00 and -24:00 should return the same result.

Here at Exercism the tests are organized in a language-independent problem-specification. Although the tracks are free not to implement selected tests or add new tests in their track, that’s rare.

If you want to propose a new test or changes to the existing tests, I’d like to encourage you to discuss that first here in the forum.

For an additional test you will get asked what value it adds. Does it help the students solve the exercise? Does it cover a bug that can be found in several published solutions? If yes, the chances of this new test getting added are good.
But there’s also the aspect that the existing solutions will be marked as outdated (which is a minor nuisance for the students) and might have to be retested (which can be expensive because Exercism has to pay for that.)

Hi!
Yeah, Totally makes sense, what you’re saying. Although in this particular situation, tests are only checking that hour 24:00 is correctly shown as 00:00 only if input was positive. If it was negative, the test won’t catch it. Seems like some (maybe not so significant) hole in the system :slight_smile: .

It really depends on how someone implemented the solution, of course. Maybe some students made it work even without this test_case.

I am also new to contributing community, so thanks a lot for feedback. It is nice to learn something new on how it works around here :smiley:

The tests here at Exercism are not meant to be exhaustive. They should cover some fundamental cases, should cover bugs that are likely to occur, and they should guide the students when solving the exercise (similar to Test-Driven Development).

If you can find multiple solutions with a specific bug that this test would catch, or if you can convince others here on the forum that this bug is likely to occur then your new test will probably be added. Otherwise probably not.

Gotha. Thanks a lot and have a good day! :smiley: