Ad
  • Custom User Avatar

    I'd be happy to.

    The text you see there is written as a [comment](https://en.wikipedia.org/wiki/Comment_(computer_programming) so it just informs you and doesn't do anything. In software development there is a methodology named "Agile" which focuses on TDD (test driven development) - it's basically custom written testcases suited to the current project. The "Run Examples" section follows this concept so that the user can write their own custom testcases if they so choose so (it's optional). When creating a Kata the author has the option to either put the "Examples" full of examples testcases, or they can leave it blank and the TDD box will appear for custom written testcases.

    The testing framework on Codewars is custom and so these functions are premade & preloaded already for you. They are used for creating/authoring your own Kata and each function has a different purpose - see here for information.

    • test.expect checks if the actual and expected match through a Boolean value.
    • test.assert_equals checks equality between actual and expected

    blah blah blah look at the link before for more info

    Example

    Test.assert_equals(whatCentury("1999"), "20th", "With input '1999' solution produced wrong output")
    
    It runs the function whatCentury with the parameter "1999" and if the return value is equal to the expected value of "20th" it passes, else error is given.
    

    tl;dr it's for user custom tests

  • Custom User Avatar

    I'm assuming you're clicking the "Run Examples" tab which is just a section for example test cases. Click "Attempt" to go through the actual testcases which allow you to pass and submit your solution.