diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 80df736..fbb008e 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -915,6 +915,18 @@ fn compare_plain_text<'s>( let mut this_status = DiffStatus::Good; let mut message = None; let text = emacs.as_text()?; + let emacs_text_length = { + let start_ind: usize = text.properties.get(0).expect("Should have start index.").as_atom()?.parse()?; + let end_ind: usize = text.properties.get(1).expect("Should have end index.").as_atom()?.parse()?; + end_ind - start_ind + }; + if rust.source.len() != emacs_text_length { + this_status = DiffStatus::Bad; + message = Some(format!( + "(emacs len != rust len) {:?} != {:?}", + emacs_text_length, rust.source.len() + )); + } let unquoted_text = text.unquote()?; if unquoted_text != rust.source { this_status = DiffStatus::Bad;