Outline for the wasm compare function.

This commit is contained in:
Tom Alexander
2023-12-26 18:55:28 -05:00
parent 9a13cb72c6
commit 68ccff74fa
6 changed files with 55 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
#![feature(exact_size_is_empty)]
use std::io::Read;
use organic::settings::GlobalSettings;
use wasm::wasm_parse_org;
mod error;
@@ -10,6 +11,7 @@ mod wasm;
use crate::init_tracing::init_telemetry;
#[cfg(feature = "tracing")]
use crate::init_tracing::shutdown_telemetry;
use crate::wasm::compare::wasm_run_anonymous_compare_with_settings;
#[cfg(feature = "tracing")]
mod init_tracing;
@@ -40,10 +42,12 @@ async fn main_body() -> Result<(), Box<dyn std::error::Error>> {
let org_contents = read_stdin_to_string()?;
let wasm_result = wasm_parse_org(org_contents.as_str());
println!("{}", serde_json::to_string(&wasm_result)?);
// if run_anonymous_compare(org_contents).await? {
// } else {
// Err("Diff results do not match.")?;
// }
if wasm_run_anonymous_compare_with_settings(org_contents, &GlobalSettings::default(), false)
.await?
{
} else {
Err("Diff results do not match.")?;
}
Ok(())
} else {
todo!()