[pve-devel] [PATCH installer v2 11/17] auto-installer: tests: replace manual panic!() with assert_eq!()
Christoph Heiss
c.heiss at proxmox.com
Thu Jul 18 15:48:56 CEST 2024
Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v1 -> v2:
* new patch, suggested by Stefan
---
proxmox-auto-installer/tests/parse-answer.rs | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/proxmox-auto-installer/tests/parse-answer.rs b/proxmox-auto-installer/tests/parse-answer.rs
index 450915a..1fc515e 100644
--- a/proxmox-auto-installer/tests/parse-answer.rs
+++ b/proxmox-auto-installer/tests/parse-answer.rs
@@ -75,12 +75,8 @@ fn test_parse_answers() {
path.push(format!("{name}.json"));
let compare_raw = std::fs::read_to_string(&path).unwrap();
let compare: Value = serde_json::from_str(&compare_raw).unwrap();
- if config != compare {
- panic!(
- "Test {} failed:\nleft: {:#?}\nright: {:#?}\n",
- name, config, compare
- );
- }
+
+ assert_eq!(config, compare);
}
}
}
--
2.45.1
More information about the pve-devel
mailing list