Compare quoted strings.
This commit is contained in:
parent
777c756a7f
commit
ef549d3b19
@ -309,6 +309,7 @@ fn compare_ast_node<'e, 's, 'w>(
|
||||
{
|
||||
// Compare children.
|
||||
let mut layer = WasmDiffResult::default();
|
||||
layer.name = "children".into();
|
||||
if let Some(wasm_iter) = wasm
|
||||
.get("children")
|
||||
.map(|children| children.as_array())
|
||||
@ -339,7 +340,17 @@ fn compare_quoted_string<'e, 's, 'w>(
|
||||
wasm: &'w String,
|
||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
||||
let mut result = WasmDiffResult::default();
|
||||
// TODO
|
||||
let emacs_text = unquote(emacs)?;
|
||||
if wasm.as_str() != emacs_text {
|
||||
result.status.push(WasmDiffStatus::Bad(
|
||||
format!(
|
||||
"Text mismatch. Emacs=({emacs:?}) Wasm=({wasm:?}).",
|
||||
emacs = emacs_text,
|
||||
wasm = wasm,
|
||||
)
|
||||
.into(),
|
||||
));
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
@ -497,6 +508,7 @@ fn compare_plain_text<'e, 's, 'w>(
|
||||
wasm: &'w serde_json::Map<String, serde_json::Value>,
|
||||
) -> Result<WasmDiffResult<'s>, Box<dyn std::error::Error>> {
|
||||
let mut result = WasmDiffResult::default();
|
||||
result.name = "plain-text".into();
|
||||
if !is_plain_text(wasm) {
|
||||
result.status.push(WasmDiffStatus::Bad(
|
||||
format!(
|
||||
|
Loading…
Reference in New Issue
Block a user