Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yup, I think it's sometimes a necessary trade-off between completeteness of output and its readability :( Merged, thanks!
Done, in the end I collapsed them all. Too ugly and unreadable to do the
(x more)
thingOups, 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.
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).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 ownit
but moving the input fromit_message
toerror_message
and put it in third arg ofassert.are.same
is best. We don't have the long annoyingit_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 pressAttempt
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 ? IdkJust 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.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).
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.
done
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?
expected
andactual
in the right order when comparingassert.are.same
takes arguments in this order : (expected
,actual
,error_msg
). You swappedactual
andexpected
.Out of curiosity, why do you call
math.random()
3 times afterrandomseed
?