Ad
  • Custom User Avatar

    Yup, I think it's sometimes a necessary trade-off between completeteness of output and its readability :( Merged, thanks!

  • Default User Avatar

    Done, in the end I collapsed them all. Too ugly and unreadable to do the (x more) thing

  • Default User Avatar

    Oups, sorry I just saw your message and so the end of it. I'll be careful next time. I'll try the ellipsis proposition and if I don't like it, I'll just collapse them I think.

  • Custom User Avatar

    I just don't know how to name each it_message. "Test" or sth else ? Idk

    This is the reason why I usually collapse such tests to a single it: because I do not have a good idea for titles either :) Naming all tests "Test" seems pointless. What I sometimes do is to build title from input up to some length, and truncate with ellipsis when the length is excedeed (for example: friends = { 'John', 'Tim', 'Anne', (5 more) }, and present full input with the failure message. Will it work well for this challenge? I do not know, would have to check and see. If you want to try, go ahead (one thing to remember: if you are going to propose changes to a language which is already approved, remember to use the "Fork" button in the kata, under the "TRAIN" button, and not in a translation).

  • Default User Avatar

    Don't worry, I was saying that in a sarcastic way, I don't care (I think I even like it, I always learn sth). So don't worry and keep correcting me please.

    I get what you mean for the Random tests. I think if we keep each test in it's own it but moving the input from it_message to error_message and put it in third arg of assert.are.same is best. We don't have the long annoying it_message for successful cases but still get multiple inputs in case of errors. Having multiple inputs at once is easier I think so we don't have to press Attempt multiple times to get examples of input.

    I can take care of that if you want. I just don't know how to name each it_message. "Test" or sth else ? Idk

  • Custom User Avatar

    Just know that my goal is not to plus-one anyone, but to improve coverage, and occasionally make something clearer if possible. You can always let me know when you do not agree with any of my changes.

    In case of this particular translation, I am not sure about the looooong titles of test sections. Usually, when inputs or outputs are expected to be loooong, I put all tests in a single it, loop over them, and present only the first failure. This way, I have only a small section titled "Random tests" or something, and not a long scroll of titles. But it's only my preference. We can leave tests here how they are, and see how they work for others.

  • Default User Avatar

    Almost frustrating how you always find a way to improve my forks/translations. Way to go for me.
    Anyway, looks good to me ! It is much clearer and better (don't like this word but i can't think of another one).

  • Custom User Avatar

    Please see my fork for a proposal of some (hopefully) improvements. Let me know if there is somethign blatantly wrong with my LUA, or just fork and fix.

  • Default User Avatar
  • Custom User Avatar

    I would suggest not making the random names jAGgeD cAsE. They look bad when reported, and varied casing does not add much to this particular problem. Maybe making them regular Name Case would be enough?

  • Default User Avatar
    • changed kata description to be more readable
    • added structure and assertion message to fixed tests
    • got rid of reference solution
    • put expected and actual in the right order when comparing
  • Default User Avatar

    assert.are.same takes arguments in this order : (expected, actual, error_msg). You swapped actual and expected.

    Out of curiosity, why do you call math.random() 3 times after randomseed ?