Ad
  • Custom User Avatar

    No, you're failing the second test in the "error handling" group:

    it("error handling", () => {
      Test.assertEquals( encode( "abc", "x" ), null );
      Test.assertEquals( decode( "abc", [4] ), null );
      Test.assertEquals( decode( "abc", [-1,-2] ), null );
    });
    

    Not a kata issue.

  • Default User Avatar

    JS - Fixed test error handling is broken when returning null

    "abc" "x"

    expected '' to equal null

  • Default User Avatar
  • Default User Avatar

    You definetely can return a lambda function. Moreover, you can return lambda function from another lambda function.

  • Custom User Avatar

    can someone explain to me as to why you cant return a lambda function and give me some examples

  • Custom User Avatar

    Thanks, but it's not an assertion error. Looks like a bug in checking code:

    java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
    at java.base/java.util.Objects.checkIndex(Objects.java:359)
    at java.base/java.util.ArrayList.get(ArrayList.java:427)
    at BurrowsWheeler.decode(BurrowsWheeler.java:37)

    Also, I see something similar has been reported for Python and C++ some time ago.

  • Custom User Avatar

    Hi,

    not an issue, a question.

    something here might help

    cheers

  • Custom User Avatar

    Java:
    Attempt fails on assertEquals("Mellow Yellow", BurrowsWheeler.decode("ww MYeelllloo", 1)) with "java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1" message. Same thing passes when hitting Test button.

  • Custom User Avatar

    Approved

  • Custom User Avatar
  • Custom User Avatar

    Very good challenge, took me quite a bit of brainpower to figure it out... hoping to encounter more like this.

    Creating this solution was both enlightening and challenging, especially when it came to handling edge cases. One key complexity arose from dealing with scenarios where there was only one unique character in the input string. The original instructions left room for interpretation on this specific case, and my initial approach ended up returning an empty list, which didn't align with the test expectations.

  • Custom User Avatar

    if it overflows the flower will have many petals, an overflower if you will

  • Default User Avatar

    there is an issue with PHP empty strings test
    PHPUnit_Framework_Exception: Argument #2 (No Value) of PHPUnit_Framework_Assert::assertCount() must be a countable or traversable

  • Default User Avatar

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

  • Custom User Avatar

    If you do not want cheaters, you have to make it more challenging. ;)

  • Loading more items...