Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed May 21, 2019
1 parent ee00067 commit 580cc47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/tests/tests/custom_sections.rs
Expand Up @@ -48,7 +48,7 @@ fn round_trip_unkown_custom_sections() {
[(world_id.into(), world.data())]
);

let wasm = module.emit_wasm().unwrap();
let wasm = module.emit_wasm().unwrap().wasm;
let mut module = config.parse(&wasm).unwrap();

let world_round_tripped = module.customs.remove_raw("hello").unwrap();
Expand All @@ -58,6 +58,6 @@ fn round_trip_unkown_custom_sections() {
assert_eq!(new_world.data(), world.data());
module.customs.add(new_world);

let new_wasm = module.emit_wasm().unwrap();
let new_wasm = module.emit_wasm().unwrap().wasm;
assert_eq!(wasm, new_wasm);
}
8 changes: 5 additions & 3 deletions crates/tests/tests/spec-tests.rs
Expand Up @@ -89,12 +89,14 @@ fn run(wast: &Path) -> Result<(), failure::Error> {
.context(format!("error parsing wasm (line {})", line))?;
let wasm1 = wasm
.emit_wasm()
.context(format!("error emitting wasm (line {})", line))?;
.context(format!("error emitting wasm (line {})", line))?
.wasm;
fs::write(&path, &wasm1)?;
let wasm2 = config
.parse(&wasm1)
.and_then(|m| m.emit_wasm())
.context(format!("error re-parsing wasm (line {})", line))?;
.context(format!("error re-parsing wasm (line {})", line))?
.wasm;
if wasm1 != wasm2 {
panic!("wasm module at line {} isn't deterministic", line);
}
Expand Down Expand Up @@ -122,7 +124,7 @@ fn run(wast: &Path) -> Result<(), failure::Error> {
walrus::passes::gc::run(&mut module);
}

let wasm = module.emit_wasm()?;
let wasm = module.emit_wasm()?.wasm;
fs::write(&file, wasm)?;
}

Expand Down

0 comments on commit 580cc47

Please sign in to comment.