Compare document category.

This commit is contained in:
Tom Alexander
2023-09-29 20:23:02 -04:00
parent 93f1bcd744
commit d1dac0b8de
4 changed files with 27 additions and 1 deletions

View File

@@ -438,7 +438,28 @@ pub fn compare_document<'s>(
Ok(_) => {}
}
// TODO: Compare :path :CATEGORY
// TODO: Compare :path
// Compare category
let category = get_property_quoted_string(emacs, ":CATEGORY")?;
match (category.as_ref(), rust.category) {
(None, None) => {}
(None, Some(_)) | (Some(_), None) => {
this_status = DiffStatus::Bad;
message = Some(format!(
"Category mismatch (emacs != rust) {:?} != {:?}",
category, rust.category
));
}
(Some(e), Some(r)) if e != r => {
this_status = DiffStatus::Bad;
message = Some(format!(
"Category mismatch (emacs != rust) {:?} != {:?}",
category, rust.category
));
}
(Some(_), Some(_)) => {}
};
// Skipping "org-data" and its properties
for (i, token) in children.iter().skip(2).enumerate() {