Documentation
¶
Overview ¶
Package fixturetest runs each rule against its fire/pass fixture trees and asserts findings match declared expectations exactly (spec §7).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalIn ¶
EvalIn evaluates one rule over the fixture tree rooted at dir, returning its findings PRE-suppression together with the walked FileSet. The caller passes a rule whose checker is already the one it wants exercised (see runFixture's Fresh below); EvalIn owns only what a fixture run must not inherit from the repo, so that policy lives in exactly one place rather than once per caller.
Allowlists are repo-scoped: their entries are repo-relative paths, but fixture trees have their own, unrelated path namespace (fixture-root- relative). A colliding path must not be suppressed here. Markers stay active — fixtures legitimately exercise marker suppression.
scan.ignore is likewise repo-scoped: its globs are repo-root-relative, but this walk's root is the fixture dir. Applying them here would be the same namespace collision the allowlist nil exists to prevent — a fixture that happens to contain vendor/ must still be checked. The same holds for scan.gitignore, and more sharply: the paths a consumer's .gitignore covers (build/, .dart_tool/, node_modules/) are exactly the ones fixture trees like to use, so a repo-level prune would blind fire fixtures that live there — and a fire fixture that stops firing reports as a passing rule. Pinned by TestFixtureRunsAreScanIgnoreFree + TestFixtureRunsAreGitignoreFree.
Second consumer: lint's prefilter-load-bearing fixture differential (#133), which evaluates a rule and its prefilter-stripped twin over these same trees. It needs the identical walk semantics — a repo-level prune there would hide exactly the fire fixture that proves a prefilter load-bearing.
func Run ¶
func Run(cfg *config.Config, allRuleIDs []string, root string, workers int, w io.Writer) (int, error)
Run evaluates every rule's fixtures under root/.formwork/fixtures and writes verdicts to w. It returns the number of failing verdicts (rules whose fixtures misbehaved, plus fixture dirs matching no rule id). Infrastructure problems (unreadable dirs, bad manifests, un-refreshable rules, symlinked fixture trees) return an error instead — never a silent pass.
allRuleIDs is the FULL corpus id set, collected before any --rule scoping narrows cfg: the orphan check must know every legitimate fixture-dir name, or a scoped run would read sibling rules' fixtures as orphans (#58). A dir matching no id in that full set is still a FAIL finding; it does not abort the run (#9).
Types ¶
This section is empty.