Ad
  • Default User Avatar

    I'm getting the same error (in Java) and am passing the test case in description. Any other hints about what this test case is looking for?

  • Custom User Avatar

    Is it possible to have better error messages? I'm doing this in clojure. The tests pass when I run them, but a test fails when I submit. I've run the code locally with a varied number of inputs and I'm not getting any problems. Would be helpful if the error message was a bit more informative.

  • Custom User Avatar

    Giacomo Sorbi has given you the answer.

  • Default User Avatar

    No worries! I really didn't think there was anything you could do about it, but I'd thought I'd leave it here, just in case someone else is struggling with the same thing.

    Thanks!

  • Custom User Avatar

    Ohk now I get it and FYI I don't own the java version. And now I can't edit the test cases because 500+ users have solve this kata so it's now uneditable :(

  • Default User Avatar

    No, I've solved it. I'm saying that the arguments passed to the test cases are in the wrong order. The actual result your code produces is listed under the "expected" category, and the expected time is listed under the "saw" category.

    So you have this:
    assertEquals(NthSeries.seriesSum(5), "1.57");

    When it should be:
    assertEquals("1.57", NthSeries.seriesSum(5));

    That's all.

  • Custom User Avatar

    This is just for marketing purposes: I have authored a Complete the pattern kata series currently not available in java but I'm going to translate them within few days...So keep a track of them and I bet you will like the series. And in the meantime you can have a look at Complete The Pattern #1 to get the taste of Complete The Pattern Series ^_^

  • Custom User Avatar

    So did you completed the kata now?? And what did you wanted me to do :-/ I can't solve the kata for you...That's your code which is producing false output. Anyways if you want some help then post your solution as a spoiler then someone might help you out ^_^

  • Default User Avatar

    Oh, it seemed to have erased part of the error message I copied in:
    When I failed the first test case, I received this message:

    test1(NthSeriesTest)
    expected: 1.[68] but was: 1.57

    This, to me, reads that the test case was expecting 1.68, and my code was producing 1.57; however, it was the other way around: 1.68 is what my code was producing, while 1.57 was what the test case is looking for. So basically I spent a lot of time trying to figure out why my solution was producing 1.68 locally, but failing the test case online... It's just my two cents. Trying to keep others from making my mistakes.

  • Custom User Avatar

    Can you elaborate this I believe the arguments in the test cases are in the wrong order. ??

  • Default User Avatar
  • Custom User Avatar

    Which language are you solving in??

  • Default User Avatar

    I believe the arguments in the test cases are in the wrong order.
    test1(NthSeriesTest)
    expected:<1.[68]> but was:<1.[57]>
    1.68 is what my code was producing, while 1.57 was what the test case is looking for. Just so you know.

    Also, from the examples, I thought the series was part of the string that was returned "1 + ... = "1.57"", so it took me a long time to figure out why I was failing test cases. Maybe you could make that part a little more clear?

    Otherwise, great kata.