Ad
  • Custom User Avatar
  • Custom User Avatar

    Holy fuck the Python tests were written by a literal psychopath.

    None of the other languages I looked at generate tests like that anyway so I'm gonna just remove them.

  • Custom User Avatar

    You may have sussed it out by now, but some of the random test strings actually have double whitespace, and some of the test case outputs don't represent the double whitespace difference clearly due to word wrap.

  • Custom User Avatar

    RE the Python version:
    The exercise description explitly warns the user that inputs may have TRAILING whitespace.
    It says nothing about the mid-string double whitespaces that occur during the random acceptance tests.

    Combined with the word-wrap on the failed test strings, and the difficulty in visually parsing a random group of letters split by what you're assuming to be single whitespace characters, this results in the test case appearing to show for example "this string" should be "this string". But with a double whitespace invisible to the user due to being wrapped on to a new line. This can prove very challenging for a rookie to debug, especially with the limited ability to display script output within Codewars.

    It's likely that a user will split a string using ' ' explitly to represent whitespace between words, and strip trailing space from their result, but not expect double whitespaces within the string itself.

    I'd suggest updating the description to explitly state double whitespaces may be included, and/or add to the fixed test cases examples where the string has double whitespaces between words.