From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <mira@nena.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 191A193706
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:43 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id EF9064231
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:12 +0100 (CET)
Received: from nena.proxmox.com (unknown [94.136.29.99])
 by firstgate.proxmox.com (Proxmox) with ESMTP
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:11 +0100 (CET)
Received: by nena.proxmox.com (Postfix, from userid 1000)
 id CB080CC061; Tue, 20 Feb 2024 11:07:11 +0100 (CET)
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Date: Tue, 20 Feb 2024 11:06:45 +0100
Message-Id: <20240220100648.44119-2-m.limbeck@proxmox.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240220100648.44119-1-m.limbeck@proxmox.com>
References: <20240220100648.44119-1-m.limbeck@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.633 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery
 methods
 RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_NONE                0.001 SPF: sender does not publish an SPF Record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pmg-devel] [PATCH v3 pmg-log-tracker 2/5] tests: improve test
 output consistency
X-BeenThere: pmg-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Mail Gateway development discussion
 <pmg-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pmg-devel/>
List-Post: <mailto:pmg-devel@lists.proxmox.com>
List-Help: <mailto:pmg-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 20 Feb 2024 10:07:43 -0000

`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

v3:
 - unchanged

 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