Skip to main content

evaluate_scoped

Function evaluate_scoped 

Source
pub fn evaluate_scoped(
    survivors: Vec<Survivor>,
    mutated: &MutatedLines,
    whole_file: &[String],
    line_scoped: &BTreeMap<String, BTreeSet<u32>>,
) -> Result<Vec<Survivor>>
Expand description

Apply file- and line-scoped mutation exemptions to the raw survivors, with the #226 determinism guard. mutated is the set of (file, line) that produced a viable mutant (caught or survived); whole_file is the file-level exemptions and line_scoped the per-line ones.

Guard: a line-scoped exemption that names a line whose mutants were all caught (in mutated, but with no survivor) is over-exemption — a hard error, the counterpart to the stale-path rule. A listed line with no mutant at all is left alone (it may simply be outside a --base diff), neither an error nor a drop. Then every survivor whose file is whole-file-exempt, or whose (file, line) is line-exempt, is dropped; an unlisted survivor still fails the gate.