1 #![cfg(not(miri))] 2 3 use wasmtime::*; 4 5 #[test] test_module_no_name() -> wasmtime::Result<()>6fn test_module_no_name() -> wasmtime::Result<()> { 7 let engine = Engine::default(); 8 let wat = r#" 9 (module 10 (func (export "run") (nop)) 11 ) 12 "#; 13 14 let module = Module::new(&engine, wat)?; 15 assert_eq!(module.name(), None); 16 17 Ok(()) 18 } 19 20 #[test] test_module_name() -> wasmtime::Result<()>21fn test_module_name() -> wasmtime::Result<()> { 22 let engine = Engine::default(); 23 let wat = r#" 24 (module $from_name_section 25 (func (export "run") (nop)) 26 ) 27 "#; 28 29 let module = Module::new(&engine, wat)?; 30 assert_eq!(module.name(), Some("from_name_section")); 31 32 Ok(()) 33 } 34