Repository navigation
t27o: direct tests for every function of rust_convert.t27 -- coverage 9 % to 100 % (Closes #10825) - #10883
Conversation
|
Review (orchestrator, Opus): re-ran on the PR head -- the spec diff against #10817 is additions only (7,044 test lines, 0 removed); |
…t27 -- byte classes, quoted/raw/num ends, op2/op3, item_end, is_tail, skip_arm, the reader predicates and refusals (Closes #10825) Tests only; no non-test line changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_convert.t27 -- put_*, insert/wrap, reserved, prim/heap, angles, result_ty, param_slice, nested_elem, ty (Closes #10825) Tests only; no non-test line changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lets, ?, vec! locals, if / if let / while let, for forms, match, asserts and result asserts (Closes #10825) Tests only; no non-test line changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…passes of rust_convert.t27 -- coverage 100 %; gen-rust test count and seal re-saved (Closes #10825) Tests only; no non-test line changes. t27c coverage: 360 of 360 functions named by a test (was 32). t27b 290 / 290, test-report vacuous 0 of 290, the seal of rust_convert.t27 re-saved and verified; the seals of rust_std, spice_convert, golden, ledger, service and install still verify. The regenerated gen/rust/tools/t27o/rust_convert.rs differs by one comment line (the count of tests it does not lower). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dc1251e to
bf74fb4
Compare
Closes #10825. Lane C1 of the coverage epic #10522 (option A, coverage to 100 %).
Stacked on #10817 (branch
t27o/std-methods-dedup-10764, which also edits rust_convert.t27): this branch is based on it, so the diff against master shows #10817's changes too until that lands. The new commits are the eight after it.Coverage
t27c coverage specs/tools/t27o/rust_convert.t27: 32 of 360 functions (9 %) before, 360 of 360 (100 %) after. Nothing is left untested.What changed
Tests only, appended after the existing ones in
specs/tools/t27o/rust_convert.t27: 161 newtestblocks (129 before, 290 after), 7044 lines added, 0 lines removed or changed. No existing test was touched; no non-test line was touched. Each test names its functions by direct call, asserts values derived by reading the function (not the output of a run), checks both sides of every predicate and the edges (empty text, a token at the last byte, the end of the buffer, a full or tiny buffer); a function that only writes into the state or the output has its observable effect asserted (the bytes throughout_is, or a state slot).quoted_end/raw_end/num_end,op2/op3,item_end,is_tail,skip_arm,refuse/want)deps,use_names, method / impl lookupsput_*,insert/wrap,reserved, angles,result_ty,ty)find, struct lookups)method/expand, paths, literals,cfg_eval,primary)let,?,vec!locals,if/if let/while let,for,match, asserts, result asserts)put_reason,put_refusal, derives, params,fn_head,stub,vkind,put_value,put_call,put_print,vectors)Gates
t27b test: 290 passed, 0 failed (was 129).t27c test-report: 290 / 290,vacuous passes 0 of 290.t27c gen-rust: it differs by one comment line only (// NOT LOWERED BY THIS BACKEND: 290 test(s), was 129), as tests are not lowered. Staged..trinity/seals/t27o_T27oRust.jsonre-saved and verified. The seals of rust_std, spice_convert, golden, ledger, service and install still verify (spice_convert uses rust_convert; its closure hash did not move).python3 -I tools/dupe_scan.py: no new duplicate body, no known group grew.python3 -I tools/check_devhome_paths.py: OK. ASCII only.tri t27ochanges: only a comment of the generated Rust (above) and the tests differ.What the tests found wrong (non-test lines left alone, one issue each)
static mutis recorded under the namemut, so every later fn with alet mutis refused #10829: astatic mutis recorded in the name table under the namemut(const_itemdoes not step over it), so every later fn that has alet mut/&mutis refused with "uses refusedmut". Shown byknown_defect_a_static_mut_is_named_mut_by_item_named_and_const_item, which pins today's behaviour and flips when it is fixed.let t = n.value.trim(); t.starts_with(..)is refused while the inline chain converts #10834:str_chainnever opens with a text field (its field branch asks for a(after the field name), solet t = n.value.trim(); t.starts_with(..)is refused while the same chain inline converts. Shown byknown_defect_str_chain_does_not_open_with_a_text_field.mod names;slips through #10843: theint_type_namessplice refusal inpathcompares themodalias, not the#[path]module, somod names;slips through and emits the spec the refusal exists to prevent. Shown byknown_defect_the_splice_refusal_reads_the_alias_not_the_module_path.int_ok(64, unsigned, ..)computesbit(64), which overflows:usize/u64/u128parameters get none of the body-derived oracle samples (ax == 5body is sampled with 4, 5, 6 foru32and not forusize). A test cannot pin this one: the call traps under t27b and t27c, soint_okis tested for 8, 16, 32 bits and the signed 64-bit type only.Observed and not filed (harmless on valid Rust, no test pins them as right):
mentionswith ahipast the source length never ends (found by a hang in a test; the callers keephi <= src.len, and otherwhile (q < hi)loops have the same shape);chars_iterwith no{in the buffer answers as if the end of the buffer were the brace;ret_has_strsays anOption<String>/Result<String, E>result is a text in its comment, but only a bareStringandstrare (those results are refused before this matters).Traps for the next person
clear(st)zeroes the STATE slots only: the declaration index (IXON, IXHIT, IXB, IXBN, IXTOP, slots 53..57) survives it. A test that callsprescan/index_declsand then reuses the samestfor another source reads a stale index and misses declarations; setst[IXON] = 0(or use a fresh vector) afterclear.srcmatches whatever text sits at those positions in a differentsrcpassed later.add_namereturns without a sign), so tests that add several names use 128+.🤖 Generated with Claude Code