From a36803db4ab2b4f870535823c6a7e5f35fbf4b81 Mon Sep 17 00:00:00 2001 From: Mira Limbeck Date: Tue, 20 Feb 2024 11:06:45 +0100 Subject: [PATCH] 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 --- tests/utils.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/utils.rs b/tests/utils.rs index 936efc9..f303fc3 100644 --- a/tests/utils.rs +++ b/tests/utils.rs @@ -26,21 +26,21 @@ pub fn compare_output(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); } }