testing

API Reference

Structs

struct Failure

A failed test assertion and the test that produced it.

struct TestCase

A named test and the block that runs it.

Effects

effect 'fail(message: String) -> ()

Reports a failed assertion to the active test runner and then resumes the test.

effect 'registerTest(testCase: TestCase) -> ()

Registers a test case during test-module initialization.

Functions

func assert(_ condition: Bool) 'fail

Reports the default assertion message when condition is false.

func assertMessage(_ condition: Bool, _ message: String) 'fail

The pre-reset stdlib's name for assert_message; existing programs (talk-syntax among them) call it, so it stays as an alias.

func report(tests: [TestCase], failures: [Failure])

Prints either a passing count or every recorded failure.