Answer stability round 1: 0 🔴, 1 🟡 (0 misread); 0 🔴, 1 🟡 (0 misread); make planted's Rust reader required and test it through planted_tasks, and sort the settings file after the code

This commit is contained in:
2026-12-02 00:03:59 +01:00
parent ea608fe5d0
commit 6a5eaa6c1f
3 changed files with 19 additions and 13 deletions
+3 -3
View File
@@ -591,8 +591,8 @@ def rust_tests_of(bench: Bench) -> RustTests:
return on_disk("read the Rust files", lambda: [rust_test_files(tree) for tree in bench.trees.values()])
def planted(bench: Bench, number: int, mutant: Mutant, rust_tests: typing.Callable[[], RustTests] | None = None) -> Task | Failure | None:
"""The task of fixing mutant, with its planted tree at each side; None where the mutant doesn't become a bug at one side or the other. rust_tests is what `rust_tests_of` finds for bench, read from the trees where the caller hands none."""
def planted(bench: Bench, number: int, mutant: Mutant, rust_tests: typing.Callable[[], RustTests]) -> Task | Failure | None:
"""The task of fixing mutant, with its planted tree at each side; None where the mutant doesn't become a bug at one side or the other. rust_tests reads what `rust_tests_of` finds for bench."""
diff = bench.git("diff", "-U0", "--no-color", "--no-ext-diff", "--no-textconv", bench.sides["base"], bench.sides["head"], "--", mutant.path, cwd=bench.checkout, errors="replace")
if isinstance(diff, Failure):
return diff
@@ -605,7 +605,7 @@ def planted(bench: Bench, number: int, mutant: Mutant, rust_tests: typing.Callab
return None
# ... and the Rust test files of each side's tree, which it keeps only where it finds every one. A mutant in one of them is no bug.
if mutant.path.endswith(".rs"):
standing = (rust_tests or functools.partial(rust_tests_of, bench))()
standing = rust_tests()
if isinstance(standing, Failure):
return standing
if any(tests is None or mutant.path in tests for tests in standing):