Rules
СсылкаTest completion and failure reporting
topaz test checks the selected entry before execution. After a successful SELF execution, it writes {entry}: test- followed by a newline to standard output. A reported runtime failure writes its diagnostic and {entry}: test failed to standard error and exits unsuccessfully. A unit with compilation diagnostics does not execute.
Success includes deferred cleanup. Deferred errors and process exit codes follow the test command.
Причина
Checking before execution prevents invalid programs from producing effects. Separate success and failure channels let test runners distinguish completion from a failed test.
Equality assertions
The operands of std. use the ordinary equality domain.
Equal values return () and execution continues. Unequal values raise TPZ4007 with the rendered actual and expected values.
Known noncomparable operands produce TPZ5007 during checking.
Argument evaluation and assertion failure follow Test comparisons.
Причина
Using ordinary value equality keeps tests consistent with comparisons in program code. Reporting both operands makes a mismatch inspectable.
Examples
СсылкаA successful test reports completion
Ссылкаlet value = 1
test-result.tpz: test-ok
Ожидаемый результат
Ожидаемый результат
Выполнение завершается. Код завершения 0.
test-result.tpz: test-ok
Equality returns unit and execution continues
Ссылкаimport std.ioimport std.testlet result: () = test.assertEq([1, 2], [1, 2])io.writeLine("{result}")
()
Ожидаемый результат
Ожидаемый результат
Выполнение завершается. Код завершения 0.
()
Reject function equality before execution
Ссылкаimport std.testfunction value(x: int) -> int { x }test.assertEq(value, value)
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
test-assert-eq-non-comparable at
test-input-bad.tpz:3:1
An unequal assertion fails the test
Ссылкаimport std.testtest.assertEq(1, 2)
Ожидаемый результат
Ожидаемый результат
The independently intended result is a nonzero exit, TPZ4007, and the test-failed footer. The dedicated installed-CLI product test has not run in this sandbox.
The intended runtime outcome is TPZ4007, an unsuccessful exit, and test- on standard error. A dedicated installed-CLI product test checks these observations for this exact fixture. Its execution awaits the public CLI integration run.