add -p argument to debug single paragraph, fix issues, sorry for the large commit...
Some checks failed
CI/CD Pipeline / test (push) Failing after 1m31s

This commit is contained in:
2024-02-15 11:40:02 +01:00
parent ddb2ebe5b7
commit 91fc2da6f7
11 changed files with 93 additions and 35 deletions

View File

@@ -122,11 +122,16 @@ mod tests {
let actual = &builder.history;
let expected = fs::read_to_string(&expected_path)
.unwrap_or_else(|_| panic!("Could not read file {expected_path}."));
let expected = expected.trim().split('\n').collect::<Vec<&str>>();
assert_eq!(actual, &expected);
match fs::read_to_string(&expected_path) {
Ok(expected) => {
let e = expected.trim().split('\n').collect::<Vec<&str>>();
assert_eq!(actual, &e);
}
Err(_) => {
let to_write = actual.join("\n");
fs::write(expected_path, to_write).expect("Unable to write file");
}
}
}
}
}