# Tests

> Test cases that run your program with a given input and check what it printed - how to write them, and what a failure is telling you.

Source: https://www.revquix.com/docs/projects/tests
Last verified: 2026-09-03

---

**If you want to check your code against examples - given this input, expect this output - that is
what tests are.** A test case is an input and the output you expect. Running the tests runs your program once per
case and compares what it printed.

## Writing one

Each case has:

- **What it checks** - a short name, for you.
- **Input** (optional) - what goes to the Input tab for this case.
- **Expected output** - what the program should print.

Cases run one at a time and each is reported separately, so a suite of five tells you which two
broke rather than that something did.

## Reading a failure

Three different things look similar and mean different things:

| What you see                 | What happened                                                         |
| ---------------------------- | --------------------------------------------------------------------- |
| **It didn't compile**        | The program never ran. No case can pass; fix the compile error first. |
| **Expected / Actual differ** | It ran and printed something else. This is a real test failure.       |
| **Couldn't run the tests**   | The runner itself was unavailable. Your code is not implicated.       |

> **Note** - Trailing whitespace is ignored on the verdict
>
> A missing newline at the end does not fail a case. Differences inside a line do.

## What tests are for here

They are for _your_ program's behaviour on inputs you choose. They are not a unit-testing framework -
there are no assertions inside your code and no test runner to configure.

That makes them a good fit for the thing people actually do in a project: check that a solution still
handles the edge cases after a change.

> **Note** - The assistant can draft cases
>
> "Generate tests" proposes a set based on your code. It costs credits and it is a starting point -
> read them, because a generated case encodes what your program _currently_ does, which is not always
> what it should do.

- [AI assist](https://www.revquix.com/docs/projects/ai-assist) - Generating cases, and what it costs.

- [Giving your program input](https://www.revquix.com/docs/projects/giving-your-program-input) - How input reaches your program.
