Skip to content

Assertions

Assertions work in Spectre as they would in any other imperative programming language.

For example:

spectre
assert 1 + 1 == 2

More complex expressions can also be put after the assert, and parenthesis following the assert keyword are optional, as is observable above.