tests/NAME.nika with the compiler’s message in NAME.stderr, blessed like output tests (ADR-269 D22)Open and answer this issue on GitHub.
tools, ready · opened 2026-10-07 · updated 2026-10-10 · 1 comment
0.0.650 and 0.0.651 moved 375 tests of what a program computes from Rust into test blocks (tests/language, tests/build-time). The owner’s aim is to have as few Rust tests as possible. What stayed in Rust is mostly refusals: a program the compiler must reject, with a given code (NK1132, …) and a given help. In jumps.rs alone that is 11 of the 19 tests that remain. A test block cannot hold one: a refused program does not build, and in a package it would take every other test down with it.
tests/errors/ holds one broken .nika per case and EXPECTED.txt with what each produces (errors.rs compares). That is a corpus of messages, not of codes per rule.nikaia test output tests (tests/NAME.stdout) but nothing for a program that must be refused..rs + .stderr, //~ ERROR annotations), trybuild’s compile-fail tests, Go’s // ERROR "regexp" comments in test files.Whether nikaia test gets a refusal test, and in which form, for example:
tests/NAME.nika with // refused: NK1132 lines (the code, optionally a fragment of the help) on the line that must carry the finding; nikaia test checks it and compares the findings. Each file is checked alone, nothing is compiled, so these are cheap.To be prepared before it is asked: how many of the remaining Rust tests are refusals of a single program, and how many also check the help’s wording (which an annotation would have to carry).
nikaia test like trybuild, in the form of the output testsCounted first (heuristic over crates/nikaia/tests):
NK code, in 129 files, with 152 distinct codes;So an expectation has to carry wording, not just a code.
The owner’s correction: the expectation is not an annotation in the source. It is a file, as NAME.stdout already is, like rustc’s UI tests (.rs + .stderr). The owner’s condition was that tests still run together. They do: a refusal never reaches rustc, so it costs a parse and a check, and the programs that build are compiled together as packages of one crate (#538, #549).
Where it is written: ADR-269 D22 and Part III 14.1 (0.0.713).
tests/NAME.nika is a test program that may use the package.NAME.stdout and NAME.stderr say what it must produce. A refusal is the compiler’s whole message in NAME.stderr, with the path written tests/NAME.nika..stderr holding it fails.--bless writes both files..stderr the same way.nikaia test finds tests/*.nika beside a package and checks each as a program that depends on the package.NAME.stderr, with paths normalised.NAME.stderr compared where it exists.Tests:
.stderr passes;.stderr fails, with a line diff;.stderr fails;.stderr holds a refusal fails;--bless writes the .stderr..stderr for the package’s own output tests. Test: a program that writes to standard error, with a matching .stderr.tests/errors/ becomes a package of test programs, one .stderr each, replacing EXPECTED.txt and errors.rs.jumps.rs’s 11 first) move into tests/*.nika + .stderr. Each step removes the Rust test it replaces.Generated by Claude Code