Ad
  • Custom User Avatar

    Congratz, and next time, please take the advice at the second post, I'm tired now ;)

    Just to make it clearer, I renamed the test in Sample test to sampleTests.

  • Custom User Avatar

    Ty for putting up with me =P

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I am not concerned with the randomised testing!
    There is a discrepency between real test results, and the results given by codewars, even though the code, and the tests are the same, as evidenced.
    (Eclipse unit tests pass, codewars unit tests fail. Same code. Same tests.)

  • Custom User Avatar

    Image of Failed Unit Tests

    (May need to right-click -> open in new tab)

  • Custom User Avatar

    Properly solve the kata or forfeit it, see the testing suite, realize the basicTests in the sample tests are one thing and the basicTests on Attempt are different (already told you this). I feel like talking to a wall here, seriously.

  • Custom User Avatar

    I am aware that the three basic tests work with my code, however the tests do not pass within the online environment

  • Custom User Avatar

    Can confirm it is JUnit from Eclipse that is telling me that the Basic Tests are working

    Image of Passed Unit Tests

  • Custom User Avatar

    Those 3 are the sample tests and always worked with your code with the import. When you click attempt, there are more tests than only those 3 in the basicTests, that's why I told you to print the input.

  • Custom User Avatar

    Here are the tests:

    assertArrayEquals(new double []{1,1,1,3,5,9,17,31,57,105}, variabonacci.tribonacci(new double []{1,1,1},10), precision);
    assertArrayEquals(new double []{0,0,1,1,2,4,7,13,24,44}, variabonacci.tribonacci(new double []{0,0,1},10), precision);
    assertArrayEquals(new double []{0,1,1,2,4,7,13,24,44,81}, variabonacci.tribonacci(new double []{0,1,1},10), precision);

    You can see the parameters where n==10.

  • Custom User Avatar

    No, because it's a problem with your code, not with the kata:

    Java Completions 6223

    The basic tests that don't work here, won't work in your IDE either (because your code can't handle them), maybe you're confusing the logs or something.

  • Custom User Avatar

    I haven't made any modifications past what I have already provided, so that is my current code.
    I could do that, and it would probably work, but that doesn't solve the issue that we can't seem to solve :/

    I misread. All of the basic tests are n==10, not 3 and therefore should not get caught in the infinite recursion part of my program, and therefore should work.

    The fact that the basic tests work offline, but then fail online, with exactly the same code is the part that is my issue. Yes changing the code will fix it, but the code I have already provided doesn't seem like it should be behaving this way...
    Would it be possible to get this marked as not resolved, and then if anyone provides an answer at a later date that explains this strange behaviour, it can be marked as resolved?

  • Custom User Avatar

    No idea, as I said, once I modified your code to handle cases < 3 it worked for me. Why don't you do that and paste your current code?

    P.D.: in basic tests there are tests with n < 3 too. And there is no test with n == 3 there.

  • Custom User Avatar

    Ok yes, in the randomised tests, 0 <= n < 3. I will admit that my approach does not work for those tests.
    But it is still failing on the basic tests, which I have done separately, and have confirmed to work. (n==3)
    And there are still randomised tests where n > 2, yet still fail...
    How are the stack overflows being caused in these cases?

  • Loading more items...