What is a test case?
A test case is a sample input and output for a given programming question, allowing you to validate the candidate's code. For every test case, we send its input to the candidate's compiled code and check that the output result is the same as the test case's expected output.
Creating a new test case
1. While creating a new Coding question, or while editing an existing one, click the "Add test case" button on the "Test Cases" step.
2. Provide the test case's name, difficulty, score, input, and output on the dialog that appears.
To avoid EOF issues, we recommend all test cases that include multi-value input follow the below format:
number of lines (ex. 4)
value of line 1 (ex. 100)
value of line 2 (ex. 500)
value of line 3 (ex. 40)
value of line 4 (ex. 200)
Furthermore, you can leverage our code stub generator to manage the input parsing for candidates. The test case input format for our code stubs are the following:
5 separate input parameters e.g. foobar(a, b, c, d, e) - separate parameters by newline:
Int / String Array - size of array follow by list of values