Ad
  • Custom User Avatar
  • Custom User Avatar

    that's quite creative

  • Custom User Avatar

    Needs random test cases. Tests are predictable and could be solved with a generator without relying on input. You're better off selecting a random hour, minute, and period in the defined range, rather than iterating through all the possible inputs systematically.

    Also, this solution passes all tests, but would fail on any 12am tests. So in addition to the random tests issue, I'd make a suggestion to include a 12am test.

    EDIT: Switched to a suggestion from an issue, because the hack to pass the systematic tests would require a codewarrior to solve the same problems they'd have to in order to complete the task as described. I do still think you're better off with a good number of random tests :) They would have picked up the 12am problem.

  • Default User Avatar

    It looks like you're right.

    I'm the author of this kata, and I know that someone else edited my test cases, so apparently they let a mistake pass through. I originally had many, many test cases (one for every minute of the day, in fact), but none of them had a 0 for the hour.

    Thanks for bringing this to my attention.

    Edit (2020-06-10): I reverted the tests so that they now handle ALL cases once again. That is, every single case is tested -- all 1440 of them.

  • Custom User Avatar

    The test cases are inccorect. It says in the instructions that the provided hours will be from 1 to 12. The test cases passes '0' as the hour and expects '0000' back.