From 4a44d8846146521acf8aa733eaf4ab57b7d10237 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 11 Oct 2023 19:05:39 -0400 Subject: [PATCH] Better error messages. --- src/compare/compare_field.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/compare/compare_field.rs b/src/compare/compare_field.rs index ed15224..797f1ef 100644 --- a/src/compare/compare_field.rs +++ b/src/compare/compare_field.rs @@ -484,8 +484,11 @@ pub(crate) fn compare_property_list_of_list_of_list_of_ast_nodes< if rust_optional.len() != middle_value.len() { let this_status = DiffStatus::Bad; let message = Some(format!( - "{} mismatch (emacs != rust) {:?} != {:?}", - emacs_field, value, rust_value + "{} optional value length mismatch (emacs != rust) {} != {} | {:?}", + emacs_field, + middle_value.len(), + rust_optional.len(), + rust_optional )); return Ok(ComparePropertiesResult::SelfChange(this_status, message)); } @@ -500,8 +503,11 @@ pub(crate) fn compare_property_list_of_list_of_list_of_ast_nodes< if rust_value.len() != mandatory_value.len() { let this_status = DiffStatus::Bad; let message = Some(format!( - "{} mismatch (emacs != rust) {:?} != {:?}", - emacs_field, value, rust_value + "{} mandatory value length mismatch (emacs != rust) {} != {} | {:?}", + emacs_field, + mandatory_value.len(), + rust_value.len(), + rust_value )); return Ok(ComparePropertiesResult::SelfChange(this_status, message)); }