Tell a Rust file's test modules apart as bytes and kill the surviving mutants
CI / tests (pull_request) Failing after 5m15s
CI / tests (pull_request) Failing after 5m15s
This commit is contained in:
@@ -196,9 +196,8 @@ def keep_rust_tests(planted_file: str, target: str) -> None:
|
||||
Raises OSError where a file cannot be read or written."""
|
||||
if os.path.islink(planted_file) or os.path.islink(target) or not os.path.isfile(planted_file):
|
||||
return
|
||||
# A Rust file is UTF-8; a byte that isn't survives the round trip.
|
||||
planted, copied = (pathlib.Path(file).read_bytes().decode("utf-8", "surrogateescape") for file in (planted_file, target))
|
||||
pathlib.Path(target).write_bytes(with_tests_of(planted, copied).encode("utf-8", "surrogateescape"))
|
||||
planted, copied = (pathlib.Path(file).read_bytes() for file in (planted_file, target))
|
||||
pathlib.Path(target).write_bytes(with_tests_of(planted, copied))
|
||||
|
||||
|
||||
def of_tests(path: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user