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)
표준 출력 없음.기대 결과
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.