Ad
  • Custom User Avatar

    Doesn't matter what the conflict was. Approved.

  • Custom User Avatar

    Hopefully the merge conflict is fixed now, as I cannot get codewars to display to me what the conflict is, and I don't see it.

  • Custom User Avatar

    Meanwhile the description changed so we have merge conflicts. Can you please fork and update to the latest description? Then I will approve.

  • Custom User Avatar

    Good idea:

    Added additional tests with altered random generation.
    Also modified reference solution to be fully regex.

  • Custom User Avatar

    I think we need to have targeted input generators. Currently in 200 random tests you have roughly 10% expecting true of which at most 2 (on average) actually contain character a/before. This means the rest of them is just a vacuous truth.
    ~2/200 test fail when you miss the endsWith condition. I'd like to have a more balanced outcome. Reducing the max input length to 100 raises to ~25% expecting true but doesn't improve the other stats.

  • Custom User Avatar

    Forked and changes applied.
    Also swapped out reference solution.

  • Custom User Avatar
    • Reference solution is wrong! Please add these also as fixed/sample test case.
    assertTrue(Kata.bestFriend("xaeaex", 'a', 'e'));
    assertTrue(Kata.bestFriend("", 'x', 'y'));
    
    • Method in solution setup needs to be static.
    • expected and actual are still swapped in random tests.
    • Random tests always expect false! 1000 is too long for input strings. Make them of random length.
    • Reduce number of random tests, 200 is enough.
    • before and after are still chosen the JS-y way.
    • No need for "Expected to return false/true", this will already be written by JUnit. "For input ..." is enough.
    • Please enclose the string in assertion messages in " and the chars in ' such that solvers can easily copy these to create own test cases.
  • Default User Avatar
  • Custom User Avatar
    • expected and actual are swapped in all assertions.
    • Please use char as input type for the letters.
    • Please add assertion messages showing the input. Otherwise you only get "expected <true> but was <false>".
    • Make reference solution and random generation methods private.
    • Java has a proper Random API. No need for JS-y Math.random() * size.
    • Please watch out for consistent indentation.
    • Random tests do not generate spaces.
  • Default User Avatar