From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C7E3E93461 for ; Mon, 19 Feb 2024 18:56:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A92493407E for ; Mon, 19 Feb 2024 18:55:55 +0100 (CET) Received: from nena.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP for ; Mon, 19 Feb 2024 18:55:54 +0100 (CET) Received: by nena.proxmox.com (Postfix, from userid 1000) id A3B9BE7C1F; Mon, 19 Feb 2024 18:55:54 +0100 (CET) From: Mira Limbeck To: pmg-devel@lists.proxmox.com Date: Mon, 19 Feb 2024 18:55:44 +0100 Message-Id: <20240219175548.311288-2-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219175548.311288-1-m.limbeck@proxmox.com> References: <20240219175548.311288-1-m.limbeck@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.679 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 v2 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2024 17:56:25 -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 --- 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(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