Handle matching no switches.
This commit is contained in:
@@ -1559,12 +1559,20 @@ 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
|
||||
));
|
||||
match (switches.as_ref().map(String::as_str), rust.switches) {
|
||||
(None, None) => {}
|
||||
(Some(""), None) => {}
|
||||
(None, Some("")) => {
|
||||
unreachable!("The organic parser would return a None instead of an empty string.");
|
||||
}
|
||||
(Some(e), Some(r)) if e == r => {}
|
||||
_ => {
|
||||
this_status = DiffStatus::Bad;
|
||||
message = Some(format!(
|
||||
"Switches mismatch (emacs != rust) {:?} != {:?}",
|
||||
switches, rust.switches
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Compare number-lines
|
||||
|
||||
Reference in New Issue
Block a user