Repository navigation
t27o: rust_convert.t27 function test coverage 9 % -> 100 % (32 of 360 functions named by a test) #10825
Description
Goal
Every function of specs/tools/t27o/rust_convert.t27 is named by a direct test (t27c coverage), each test with real assertions and both sides of the boundary it checks. Option A of #10522 ("coverage to 100 %", owner 2026-10-18 / 2026-10-19). rust_std.t27 (#10553, #10764) and ledger / golden / install / service / zig_convert are already at 100 %.
Why this matters
t27c coverage on master (2026-10-19): rust_convert.t27 has 360 functions, 32 named by a test (9 %). Most are reached only through convert / body / oracle, so a regression in a helper (tok_end, skip_ws, a refusal kind) shows up, if at all, as a changed output text far from its cause. Three of tonight's defects lived in such helpers (#10534 integer !, #10544 rescans, the super:: hole in #10648).
Deliverable
Direct tests in rust_convert.t27, in batches by area (lexing, the name table, types and classes, expressions, statements, items, the oracle, the report), each batch its own commit: inputs at the edges (empty text, end of buffer, a token at the last byte), and for each predicate a true and a false case. A function that cannot be tested directly (it only writes into the state) gets its observable effect asserted instead.
Done when
t27c coverage specs/tools/t27o/rust_convert.t27 reports every function tested, or the PR lists each untested one with the reason; t27b test passes; t27c test-report 0 vacuous; no output of tri t27o changes (tests only).
Boundary
- May touch:
specs/tools/t27o/rust_convert.t27(tests only),gen/rust/tools/t27o/rust_convert.rs(regenerated; tests are not lowered, so it should not change), its seal, and the seals of specs thatuseit (zig_convert, spice_convert) if their closure hash moves.
Links
User Scenarios
- Given the
rust_convert.t27spec with 360 functions and only 32 covered by direct tests, when a developer runst27c coverage specs/tools/t27o/rust_convert.t27, then the report shows every function named by at least one test with real assertions on both sides of its boundary. - Given a helper function such as
tok_endorskip_wsthat is only reached indirectly throughconvertororacle, when a regression is introduced in that helper, then a direct test for that helper fails immediately rather than surfacing only as a changed output text far from the cause. - Given the test batches for lexing, the name table, types and classes, expressions, statements, items, the oracle, and the report, when each batch is committed separately, then
t27b testpasses after every batch andt27c test-reportshows zero vacuous tests.
Requirements
- FR-001: Every function in
specs/tools/t27o/rust_convert.t27MUST be named by at least one direct test invoked viat27c coverage. - FR-002: Each direct test MUST contain real assertions that exercise both the true and false branch of every predicate in the function under test.
- FR-003: Tests MUST include inputs at edge boundaries: empty text, end of buffer, and a token at the last byte.
- FR-004: Functions that cannot be tested directly because they only write into state MUST have their observable effect asserted instead.
- FR-005: Tests MUST be added in batches by area (lexing, name table, types and classes, expressions, statements, items, oracle, report) with each batch in its own commit.
- FR-006: After all batches,
t27b testMUST pass andt27c test-reportMUST report zero vacuous tests. - FR-007: The generated file
gen/rust/tools/t27o/rust_convert.rsand its seal MUST not change (tests are not lowered). - FR-008: Seals of specs that
userust_convert (zig_convert, spice_convert) MUST be updated only if their closure hash moves.
Activity
t27o: direct tests for the name table, the declaration index and deps…
t27o: direct tests for the output writers and the type reader of rust…
t27o: direct tests for the class helpers of rust_convert.t27 -- liter…
t27o: direct tests for the expression engine and the literal writers …
github-actions commentedon Oct 19, 2026
Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.
FR-001: ... MUST ...t27o: direct tests for the statements of rust_convert.t27 -- blocks, …
t27o: direct tests for the item helpers and the oracle writer of rust…
t27o: direct tests for the out-buffer form, the item writers and the …
t27o: direct tests for the lexing and reader helpers of rust_convert.…
t27o: direct tests for the name table, the declaration index and deps…
t27o: direct tests for the output writers and the type reader of rust…
t27o: direct tests for the class helpers of rust_convert.t27 -- liter…
t27o: direct tests for the expression engine and the literal writers …
t27o: direct tests for the statements of rust_convert.t27 -- blocks, …
t27o: direct tests for the item helpers and the oracle writer of rust…
t27o: direct tests for the out-buffer form, the item writers and the …
t27o: direct tests for every function of rust_convert.t27 -- coverage…