diff --git a/crates/cli/src/codegen/dynamic.rs b/crates/cli/src/codegen/dynamic.rs index c50880b5..6dd56fde 100644 --- a/crates/cli/src/codegen/dynamic.rs +++ b/crates/cli/src/codegen/dynamic.rs @@ -304,3 +304,20 @@ fn print_wat(wasm_binary: &[u8]) -> Result<()> { fn print_wat(_wasm_binary: &[u8]) -> Result<()> { Ok(()) } + +#[cfg(test)] +mod test { + use super::DynamicGenerator; + use super::WitOptions; + use anyhow::Result; + + #[test] + fn default_values() -> Result<()> { + let gen = DynamicGenerator::new(); + assert!(gen.source_compression); + assert_eq!(gen.import_namespace, ""); + assert_eq!(gen.wit_opts, WitOptions::default()); + + Ok(()) + } +} diff --git a/crates/cli/src/codegen/static.rs b/crates/cli/src/codegen/static.rs index 6286a23f..b0bcdb35 100644 --- a/crates/cli/src/codegen/static.rs +++ b/crates/cli/src/codegen/static.rs @@ -201,3 +201,20 @@ fn optimize_wasm(wasm: &[u8]) -> Result> { Ok(fs::read(&tempfile_path)?) } + +#[cfg(test)] +mod test { + use super::StaticGenerator; + use super::WitOptions; + use anyhow::Result; + use javy_config::Config; + + #[test] + fn default_values() -> Result<()> { + let gen = StaticGenerator::new(Config::default()); + assert!(gen.source_compression); + assert_eq!(gen.wit_opts, WitOptions::default()); + + Ok(()) + } +}