message: Add failing underscore test
diff: @@ -371,6 +371,71 @@ fn create_exe_works_multi_command_args_handling() -> anyhow::Result<()> {
  Ok(())
  }
  +/// Tests that create-exe works with underscores and dashes in command names
  +#[cfg_attr(target_os = "windows", ignore)]
  +#[test]
  +fn create_exe_works_underscore_module_name() -> anyhow::Result<()> {
  + let temp_dir = tempfile::tempdir()?;
  + let operating_dir: PathBuf = temp_dir.path().to_owned();
  + let wasm_path = operating_dir.join(create_exe_wabt_path());
  +
  + let atoms = &[
  + "wabt",
  + "wasm-interp",
  + "wasm-strip",
  + "wasm-validate",
  + "wasm2wat",
  + "wasm-validate",
  + "wast2json",
  + ];
  +
  + let mut create_exe_flags = Vec::new();
  +
  + for a in atoms.iter() {
  + let object_path = operating_dir.as_path().join(&format!("{a}.o"));
  + let output: Vec<u8> = WasmerCreateObj {
  + current_dir: operating_dir.clone(),
  + wasm_path: wasm_path.clone(),
  + output_object_path: object_path.clone(),
  + compiler: Compiler::Cranelift,
  + extra_cli_flags: vec!["--atom".to_string(), a.to_string()],
  + ..Default::default()
  + }
  + .run()
  + .context("Failed to create-obj wasm with Wasmer")?;
  +
  + assert!(
  + object_path.exists(),
  + "create-obj successfully completed but object output file `{}` missing",
  + object_path.display()
  + );
  +
  + create_exe_flags.push("--precompiled-atom".to_string());
  + create_exe_flags.push(format!(
  + "{a}:{}",
  + object_path.canonicalize().unwrap().display()
  + ));
  + }
  +
  + #[cfg(not(windows))]
  + let executable_path = operating_dir.join("multicommand.out");
  + #[cfg(windows)]
  + let executable_path = operating_dir.join("multicommand.exe");
  +
  + WasmerCreateExe {
  + current_dir: operating_dir.clone(),
  + wasm_path,
  + native_executable_path: executable_path.clone(),
  + compiler: Compiler::Cranelift,
  + extra_cli_flags: create_exe_flags,
  + ..Default::default()
  + }
  + .run()
  + .context("Failed to create-exe wasm with Wasmer")?;
  +
  + Ok(())
  +}
  +
  // Ignored because of -lunwind linker issue on Windows
  // see https://github.com/wasmerio/wasmer/issues/3459
  #[cfg_attr(target_os = "windows", ignore)]
  