Compare keyword keys and values.

This commit is contained in:
Tom Alexander 2023-09-06 12:08:06 -04:00
parent 400f53e440
commit 7c471ab32e
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 24 additions and 1 deletions

View File

@ -1392,7 +1392,30 @@ fn compare_keyword<'s>(
Ok(_) => {}
};
// TODO: Compare key and value
let key = unquote(
get_property(emacs, ":key")?
.ok_or("Emacs keywords should have a :key")?
.as_atom()?,
)?;
if key != rust.key.to_uppercase() {
this_status = DiffStatus::Bad;
message = Some(format!(
"Mismatchs keyword keys (emacs != rust) {:?} != {:?}",
key, rust.key
))
}
let value = unquote(
get_property(emacs, ":value")?
.ok_or("Emacs keywords should have a :value")?
.as_atom()?,
)?;
if value != rust.value {
this_status = DiffStatus::Bad;
message = Some(format!(
"Mismatchs keyword values (emacs != rust) {:?} != {:?}",
value, rust.value
))
}
Ok(DiffResult {
status: this_status,