Test Cases
Test cases are used to test input and output. They can simulate a user running a program from a command line interface (CLI). A test case will provide a program with input, and monitor the output for a pre-set response or pattern.

Adding a Test Case

To add a test case, navigate to Checks in the left sidebar and use the New Check + button. Next, select the Test Case option in the drop-down and see the settings below:

Settings

Description

The test description. Shown to users if the task is live and checks are shared (which is the default).

Input / STDIN

The input strings to stream into the program. Pressing Enter saves a line of input and is equivalent to pressing Enter when running the project from a CLI.

Expected Output

The output strings expected from the program. Press Enter to save each one. The test case will be marked complete and / or graded based on the presence of these output strings.

Not Expected Output

Any strings that should not show up in the program's output. If any of these appear, the test case will be marked as failing. Useful for preventing cheating.

Ordered

If the expected output must appear in order.

Case Sensitive

If the expected output is case sensitive. If disabled, all output will be checked as lowercase.

Strict

If disabled, all output characters except for .,A-Z,a-z,0-9 and whitespace (including newlines) will be removed and repeating whitespace will be reduced to a single space / line.

Regex

If enabled, text entered in "Expected Output" will be treated as regular expressions.

Advanced Settings

Advanced settings can be accessed by clicking the Show Advanced Settings link at the bottom of the test case.

Entry Point

Override the value of the {{entry}} template with a custom value.

Timeout

Number of seconds to run the test case for before it times out.
Last modified 1yr ago