Support list with empty string as only element for empty list.

This commit is contained in:
Tom Alexander 2023-12-29 21:56:31 -05:00
parent cd6a64c015
commit eb2995dd3b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -411,7 +411,7 @@ pub(crate) fn wasm_get_emacs_standard_properties(
fn wasm_compare_list<'e, 's: 'e, 'w, EI, WI>(
source: &'s str,
emacs: EI,
mut emacs: EI,
wasm: WI,
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>>
where
@ -420,6 +420,11 @@ where
{
let emacs_length = emacs.len();
let wasm_length = wasm.len();
if emacs_length == 1 && wasm_length == 0 {
if emacs.all(|t| matches!(t.as_atom(), Ok(r#""""#))) {
return Ok(WasmDiffResult::default());
}
}
if emacs_length != wasm_length {
return Ok(WasmDiffResult {
status: vec![WasmDiffStatus::Bad(