Ad
  • Custom User Avatar

    Wait, wait and wait ~~ OR you can come to discord #reviewing to promote it

  • Custom User Avatar

    I checked before making the fix, I thought you said that the harcoded 11s were a special case and the problem was persistant after Damjan fix;
    About the thanks, no, I thank you for the time you spent. (it was a lot)
    Now I am a bit scared about writing a new kata. Anyway maybe I learned some lessons :)

  • Custom User Avatar

    With these two lines hardcoded everything seems fine, with Damjan fix :)

      let randMonth = 11;
      let randDate = 11;
    
  • Custom User Avatar

    How confusing! I think there was an error in string conversion. I tried printing the function input and got something like 1962+3376 when there was an error. I don't get any errors after replacing the relevant lines with this:

      randDate  = randDate  < 10 ? "0" + randDate  : "" + randDate;
      randMonth = randMonth < 10 ? "0" + randMonth : "" + randMonth;
    

    Try it out and see if it works.

  • Custom User Avatar

    I've put the tests in the Example tests box, too because I noticed a very strange behaviour. The tests seem to be right, however my solution does not pass the tests from time to time, however when I manually try the random input from the tests in the console the solution passes as correct! I'm staring at the monitor. Please try validating your solution many times see if you can reproduce this behaviour. I dunno what's the issue. I've logged the random numbers in the error message in assertEquals so we can see them..

  • Custom User Avatar

    yeah i saw it when i tested:) and forgot to fix it in the comment; now it's fixed

  • Custom User Avatar

    Sorry if it sounded harsh! I think this is a great first kata and the random tests in your last comment look fine to me. :) There's a small typo though, in && <= 31 and the next line.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well, I've never written some good tests in my life...Please be gentle. Also this kata allows contributors.
    I'll do my best. I'll extend Sergiu's example.

  • Custom User Avatar

    Yes, definitely add random tests. You also need to add tests with invalid months/days.

  • Custom User Avatar

    I changed the Test cases there are more now and I'd say they are unpredictable.

  • Custom User Avatar

    The point was to actually write a regex :)

  • Custom User Avatar

    True. Due to copy paste. Fixed it. Thanks!

  • Custom User Avatar

    Junior developers should know about overflow