Open and answer this issue on GitHub.
ready · opened 2026-11-01 · updated 2026-11-01 · 0 comments
About 900 lines of the compiler’s Rust are #[cfg(test)] unit tests of code that already lives in Nikaia. For example:
contracts/send.rs:197-652 tests threads.nika crossingmanifest.rs:272-512contracts/ty.rs:146-365CLAUDE.md says an existing Rust test moves to Nikaia. These tests cannot move today:
tests/compiler program cannot reach the tools’ functions.tools/*.nika file may carry a test "..." { } block. The language has them (packages, nikaia test, ADR-247 / ADR-269), but lower-std does not take them.This is an obvious extension: tests sit beside the code they test, in the language the code is written in. A test block in a tools file is the same form a package already has.
tools/*.nika file may hold test "name" { ... } blocks.lower-std lowers each one into the lowered file’s #[cfg(test)] mod tests as a #[test] fn, with the name made snake_case.cargo test -p nikaia-std runs them, and CI already runs that crate..rs is output, as it is for everything else.lower-std takes test blocks in a tools file and writes them into #[cfg(test)] mod tests of its lowered .rs.
assert lowers as it does in a function.threads.nika asserting crossing of i64 is May.Result: blocked, per CLAUDE.md.contracts/send.rs’s tests (197-652) into test blocks in threads.nika / check_send.nika.contracts/ty.rs’s tests into ty.nika.manifest.rs’s tests (272-512) into manifest.nika. Tests that go through toml (codegen_for, items_of) become tests/compiler programs, or stay where they are with a note in the report.Part of #125.