mirror of
https://git.proxmox.com/git/pmg-log-tracker
synced 2025-04-28 13:03:18 +00:00
tests: improve test output consistency
`expected` and `command` are more helpful than `new` and `old`. the order of `expected` and `command` should now always be the same: expected before command Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
parent
8a5b28ff16
commit
a36803db4a
@ -26,21 +26,21 @@ pub fn compare_output<R: BufRead, R2: BufRead>(command: R, expected: R2) {
|
||||
expected_lines.len(),
|
||||
command_lines.len()
|
||||
);
|
||||
for (old, new) in expected_lines.iter().zip(command_lines.iter()) {
|
||||
if new.starts_with("# ") && old.starts_with("# ") {
|
||||
for (expected, command) in expected_lines.iter().zip(command_lines.iter()) {
|
||||
if command.starts_with("# ") && expected.starts_with("# ") {
|
||||
continue;
|
||||
} else if new.starts_with("# ") {
|
||||
} else if command.starts_with("# ") {
|
||||
assert!(
|
||||
false,
|
||||
"comment line found in command output, but not in expected output"
|
||||
);
|
||||
} else if old.starts_with("# ") {
|
||||
} else if expected.starts_with("# ") {
|
||||
assert!(
|
||||
false,
|
||||
"comment line found in expected output, but not in command output"
|
||||
);
|
||||
}
|
||||
|
||||
assert_eq!(new, old);
|
||||
assert_eq!(expected, command);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user