Result: done Files: crates/nikaia-std/src/tools/project_tests.nika crates/nikaia-std/src/tools/lowered/project_tests.rs crates/nikaia-std/src/tools/lowered.rs crates/nikaia-std/src/lib.rs crates/nikaia/src/project.rs docs/selfhosting-plan.md assets/badges/self-hosted.svg Commit: project: the test runner’s run loop into Nikaia (P3b) Body: The cut: the loop of run_tests over tests and settings stays Rust (with Sandbox, outcome_of, the compiler’s own build/run in run_program_test, and the failures’ report, whose block-test stdout is printed through from_utf8_lossy, which std has no counterpart for; moving the loop whole would also need a throwing callback, of which tools/*.nika has none yet), and Nikaia does each test’s work: project_tests_output_outcome (reads the .out/ files from the sandbox and decides passed), project_tests_refused_outcome and project_tests_ran_outcome (run_program_test’s two outcomes), ProjectTestsBlessed with project_tests_bless and project_tests_bless_program (decision and write), project_tests_blessed_line, project_tests_explain_output, the labels, the “running N tests” and “test result” lines and the exit code. The moved Rust (bless, bless_program, Blessed, explain_output and the outcome blocks) is deleted; every printed line is the same. A write that fails while blessing now fails with std’s IoError text (it names the path) instead of anyhow’s “blessing PATH”, as P3a did for reads. clippy::manual_ok_err is allowed on the tools module (the lowering writes match fs::read(..) { Ok(v) => Some(v), Err(_) => None } for catch { null }). No .clone() for #909 was needed. Part: #125 Pushed: 5681395a94e1574f2f15837dcc6afd78ef3a897f Tests: nikaia test –both-settings –project tests/compiler 206 passed (as before); it filtered output_test program_test bless test_runner refusal + guard set 52 passed; cargo test -p nikaia –lib project:: 10 passed; –bless probe on a scratch package (an output test and a test program with wrong .stdout): both lines blessed, both files rewritten, the next run ok; lower-std fixpoint (second run unchanged); clippy clean; pre-push-check clean; self-hosting 80.6 % Gate: green Deviation: none Found: three lowering defects, met while writing the move, not in the committed code. (1) a ref Bytes? parameter lowers to Option<&[u8]> but its argument is opened with .as_ref() (Option<&Bytes>), E0308; emit_arg_opening_inside in emit_core_args.nika names only String/str for .as_deref(). (2) want?.clone() of such a parameter lowers to .to_owned() (a Vec, not Bytes), and `expected == got` then fails (`&Vec == [u8]`). (3) a match over an owned option (`match t.files[0].1?.clone() { null => .., g => g != w }`) binds `Some(ref g)` (lent_bindings, known only after the arm body) but the comparison is not marked in compared_views (local.lent is false since the subject is no view), so `&String != String` / `&Bytes != Bytes` fails in rustc; also with String. Probes: fn as_expected(want: ref Bytes?, got: ref Bytes) -> bool { return match want?.clone() { null => true, expected => expected == got } }; and in main: let w: String = f"{1}"; let t: Vec[(String, String?)] = [("a", "x")]; match t[0].1?.clone() { null => println("none"), g => { if g != w { println("differs") } } }. File as an issue (label ready). Needs: none Changelog: none Owner: none Disk freed: 0 GB (no clone, no target/ of my own) Rs2nika: kept 21 of 108 lines (19%, under 60%: draft with --profile check --prefix project_tests_ --file over the moved Rust plus the extracted outcome blocks); costliest: every signature got a `sync` the tools do not write, and `test` kept as a parameter name though it is a reserved word (parse error); `let Some((_, first)) = outcomes.first() else {..}` and `windows(2).all(..)` kept, not Nikaia (written as is_empty + project_tests_agree + outcomes[0].1); Option::is_none_or/is_some_and/as_deref kept over `Bytes?` fields (written as a match on the field), and `Blessed::Refused(&'static str)` became a wrong `NotAnEscape(String)` variant

This site is open source. Improve this page.