From 4d356b855e31bb5cec59553caf0c851a932caef5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 2 Oct 2023 22:48:54 -0400 Subject: [PATCH] Compare label. --- src/compare/diff.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index d948d494..8d99fd8f 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1172,9 +1172,20 @@ fn compare_footnote_definition<'b, 's>( ) -> Result, Box> { let children = emacs.as_list()?; let mut child_status = Vec::new(); - let this_status = DiffStatus::Good; - let message = None; - // TODO: Compare :label :pre-blank + let mut this_status = DiffStatus::Good; + let mut message = None; + // TODO: Compare :pre-blank + + // Compare label + let label = get_property_quoted_string(emacs, ":label")? + .ok_or("Footnote definitions should have a name.")?; + if label != rust.label { + this_status = DiffStatus::Bad; + message = Some(format!( + "Label mismatch (emacs != rust) {:?} != {:?}", + label, rust.label + )); + } for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) { child_status.push(compare_ast_node(source, emacs_child, rust_child.into())?);