From 650cbc17db306a0e5908c1f8ff076b46a635d95e Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 4 Oct 2023 10:03:51 -0400 Subject: [PATCH] Compare switches for example block. --- src/compare/diff.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index cffd9dc..533854f 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1545,7 +1545,7 @@ fn compare_example_block<'b, 's>( let mut this_status = DiffStatus::Good; let mut message = None; - // TODO: Compare :switches :number-lines :preserve-indent :retain-labels :use-labels :label-fmt + // TODO: Compare :number-lines :preserve-indent :retain-labels :use-labels :label-fmt // Compare value let contents = get_property_quoted_string(emacs, ":value")?.unwrap_or(String::new()); @@ -1557,6 +1557,16 @@ fn compare_example_block<'b, 's>( )); } + // Compare switches + let switches = get_property_quoted_string(emacs, ":switches")?; + if switches.as_ref().map(String::as_str) != rust.switches { + this_status = DiffStatus::Bad; + message = Some(format!( + "Switches mismatch (emacs != rust) {:?} != {:?}", + switches, rust.switches + )); + } + Ok(DiffResult { status: this_status, name: rust.get_elisp_name(),