From e6c809ab03c0b50c12dc36f3cb8d781d1f570ee5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 4 Oct 2023 09:35:19 -0400 Subject: [PATCH] Compare value for comment block. --- src/compare/diff.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 42a3d9b..1c31a82 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1513,10 +1513,18 @@ fn compare_comment_block<'b, 's>( emacs: &'b Token<'s>, rust: &'b CommentBlock<'s>, ) -> Result, Box> { - let this_status = DiffStatus::Good; - let message = None; + let mut this_status = DiffStatus::Good; + let mut message = None; - // TODO: Compare :value + // Compare value + let contents = get_property_quoted_string(emacs, ":value")?.unwrap_or(String::new()); + if contents != rust.contents { + this_status = DiffStatus::Bad; + message = Some(format!( + "Value mismatch (emacs != rust) {:?} != {:?}", + contents, rust.contents + )); + } Ok(DiffResult { status: this_status,