---
title: "Overview"
description: "All expectations — how many queries each needs and when it passes"
url: "https://docs.justcat.it/reference/tests/expectations/overview/"
---
# Overview


This is an overview of all implemented expectations, with a link to the detailed page of each. For what an *Expectation* is and why a test has one or two queries, see [Introduction](https://docs.justcat.it/reference/tests/expectations/introduction/ "Introduction").

| Expectation | Queries | Passes when |
|---|---|---|
| [Set is empty](https://docs.justcat.it/reference/tests/expectations/set-is-empty/ "Set is empty") | 1 | the query returns no row |
| [Set is not empty](https://docs.justcat.it/reference/tests/expectations/set-is-not-empty/ "Set is not empty") | 1 | the query returns at least one row |
| [Set row count](https://docs.justcat.it/reference/tests/expectations/set-row-count/ "Set row count") | 1 | the query returns exactly the number of rows you specify |
| [Sets match](https://docs.justcat.it/reference/tests/expectations/sets-match/ "Sets match") | 2 | the two queries return the same rows |
| [Contains](https://docs.justcat.it/reference/tests/expectations/contains/ "Contains") — written as `contains`, `first contains second` or `second contains first` | 2 | one set holds every row of the other; the other may hold more |

Which one to use for which question, with examples, is on [Which expectation when](https://docs.justcat.it/how-to-guides/test-patterns/which-expectation-when/ "Which expectation when") — and [My expectation does not exist](https://docs.justcat.it/how-to-guides/test-patterns/my-expectation-does-not-exist/ "My expectation does not exist") explains why five are enough.

The names are matched by [naming convention](https://docs.justcat.it/reference/project-file/naming-conventions/ "Naming conventions"): `set is not empty`, `Set Is Not Empty`, `SET_IS_NOT_EMPTY` and `SetIsNotEmpty` are the same expectation.

Every test ends with `Passed`, `Failed`, `Error` or `Inconclusive` — see [Results](https://docs.justcat.it/reference/tests/results/ "Results"). The two expectations that compare sets — sets match and contains — share three things that have pages of their own:

* [Order and key](https://docs.justcat.it/reference/tests/order-and-key/ "Order and key") — both sets must be sorted; `ORDER BY` in the query or `Sort data` on the test; and the optional `Key` that lets CAT tell a *different* row from a *missing* one.
* [Tolerance](https://docs.justcat.it/reference/tests/tolerance/ "Tolerance") — how far two numbers may be apart and still count as equal.
* [Failure message](https://docs.justcat.it/reference/tests/failure-message/ "Failure message") — what a failed test reports and the properties that shape it: `Maximum errors logged`, `Maximum sample column length`, `Log number of errors`. Set is empty uses the same properties.

