Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Profile pic

    add a pic,sloved!

  • 1575546?s=100
  • 14909989?s=100

    There are no random tests in JS version.

  • 14909989?s=100

    Provided link is broken so there's no way to decipher braille anymore.

  • 35499555?s=100

    Need random test in C++

  • 11741020?s=100

    Dectector

    Palindromization - Java 1.8.0_91(Java 8)
    I have problem with the exercise. When I run the sample test without modifying the code I get following error message.
    STDERR:
    /workspace/java/src/KataTests.java:28: error: class, interface, or enum expected
    }
    ^
    1 error

    I noticed that there is addition closing curly brace (}) with no opening brace.

    Default code

    public class Kata {
    public static String palindromization(String elements, int n) {
    return elements;
    }
    }

    Sample Test

    import org.junit.Test;
    import static org.junit.Assert.assertEquals;
    import org.junit.runners.JUnit4;
    public class KataTests {
    @Test
    public void Error_Cases() {

        assertEquals(Kata.palindromization("", 2), "Error!");
        assertEquals(Kata.palindromization("123", 1), "Error!");
    
    }
    
    @Test
    public void Examples() {
        
        assertEquals(Kata.palindromization("123", 2), "11");
        assertEquals(Kata.palindromization("123", 3), "121");
        assertEquals(Kata.palindromization("123", 4), "1221");
        assertEquals(Kata.palindromization("123", 5), "12321");
        assertEquals(Kata.palindromization("123", 6), "123321");
        assertEquals(Kata.palindromization("123", 7), "1231321");
        assertEquals(Kata.palindromization("123", 8), "12311321");
        assertEquals(Kata.palindromization("123", 9), "123121321");
        assertEquals(Kata.palindromization("123", 10), "1231221321");
        
    }
    

    } // No opening curly brace
    }

  • Profile pic

    Thanks! I thought it was my fault

  • Profile pic

    In C++ the sample test returned an error with 0 test passed, while the full test were ok

  • Profile pic

    Switched their places

  • Profile pic

    For Java the assertEquals args are back-to-front for all test cases.

    • expected should be 1st.
  • Profile pic

    I updated the testing method and a bit of the description...
    I hope it will be sufficient :D

  • Profile pic
  • 15776046?s=100

    Hi Detecter & Steffen too;-)... these facts were clear to me, it was more a hint to complete the description (normally these points would be an issue:-)). It's not the best way if you need to "google" all the information to solve a kata;-)! So thanks for the work here!

  • Profile pic

    I edited the description to be more precise.

  • Profile pic

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

  • Loading more items...