Compare switches for example block.

This commit is contained in:
Tom Alexander 2023-10-04 10:03:51 -04:00
parent 1d7770e590
commit 650cbc17db
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -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(),