Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pchickey committed Jun 1, 2021
1 parent c27e152 commit 9d15c09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/all/module_serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ fn test_version_mismatch() -> Result<()> {
.starts_with("Module was compiled with incompatible Wasmtime version")),
}

// Test deserialize_check_wasmtime_version, which disables the logic which rejects the above.
let mut config = Config::new();
config.deserialize_check_wasmtime_version(false);
let engine = Engine::new(&config);
unsafe { Module::deserialize(&engine, &buffer) }
.expect("module with corrupt version should deserialize when check is disabled");

Ok(())
}

Expand Down

0 comments on commit 9d15c09

Please sign in to comment.