Skip to main content

Crate bynk_testkit

Crate bynk_testkit 

Source
Expand description

Content-ownership track (#1086) slice 3: the cross-crate replacement for diagnose_project(&root, &HashMap::new()) and bare CompileOptions::single/::split’s reliance on bynk-emit’s disk fallback (design/tracks/content-ownership.md §3.3, §4).

Every helper here walks a project exactly the way production code already does — bynk_ide::discover_files for diagnose_project*-style callers, the same bynk_emit::project::Roots a CompileOptions will itself compile for compile_options_* — and reads every file into a complete sources map, instead of reimplementing the walk. There is no second resolution to drift from the first: a test built on these helpers cannot silently miss a file because this crate’s notion of “the project’s files” diverged from the compiler’s own.

Dev-only: this crate ships no production code and is invisible to fs_below_driver’s probe (design/greenfield-status.md), which only walks each crate’s own src/, not its dev-dependencies.

Functions§

compile_options_single
CompileOptions::single(root), with every source pre-read — the direct replacement for its reliance on bynk-emit’s disk fallback.
compile_options_split
CompileOptions::split(project_root, paths), with every source pre-read. Discovers exactly the files CompileOptions::split itself would compile — built from the same paths this call also hands to split, not re-derived from bynk.toml through a second read, so the two can never disagree.
read_project_sources
A complete (path, content) map for roots, resolved and enumerated the same way bynk_ide::diagnose_project_with’s own callers already do — the direct replacement for diagnose_project(&root, &HashMap::new())’s reliance on bynk-emit’s disk fallback filling in what the (empty) overlay doesn’t cover.