public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH v2 pmg-log-tracker 2/5] tests: improve test output consistency
Date: Mon, 19 Feb 2024 18:55:44 +0100	[thread overview]
Message-ID: <20240219175548.311288-2-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20240219175548.311288-1-m.limbeck@proxmox.com>

`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 patch can be applied regardless of any of the others. it doesn't
change any functionality, but just reorders output in case of errors to
be more consistent

 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<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);
     }
 }
-- 
2.39.2




  reply	other threads:[~2024-02-19 17:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 17:55 [pmg-devel] [PATCH v2 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Mira Limbeck
2024-02-19 17:55 ` Mira Limbeck [this message]
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-log-tracker 3/5] tests: update for log tracker time handling changes Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-log-tracker 4/5] cleanup: remove unused strftime function Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 5/5] cleanup: fix clippy warnings Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-api] MailTracker: remove timezone offset Mira Limbeck
2024-02-20  9:37 ` [pmg-devel] [PATCH v2 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Mira Limbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240219175548.311288-2-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal