Skip to content

Commit

Permalink
fix fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
macovedj committed Jun 11, 2024
1 parent 3277e9c commit 29da207
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fuzz/src/roundtrip_wit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub fn run(u: &mut Unstructured<'_>) -> Result<()> {
}

let pkg2 = pkgs2[0];
let wasm2 =
wit_component::encode(Some(true), &resolve2, pkg2).expect("failed to encode WIT document");
let wasm2 = wit_component::encode(Some(true), &resolve2, &[pkg2])
.expect("failed to encode WIT document");
write_file("doc2.wasm", &wasm2);
roundtrip_through_printing("doc2", &resolve2, &wasm2);

Expand Down Expand Up @@ -96,7 +96,7 @@ fn roundtrip_through_printing(file: &str, resolve: &Resolve, wasm: &[u8]) {

// Finally encode the `new_resolve` which should be the exact same as
// before.
let wasm2 = wit_component::encode(Some(true), &new_resolve, last.unwrap()).unwrap();
let wasm2 = wit_component::encode(Some(true), &new_resolve, &[last.unwrap()]).unwrap();
write_file(&format!("{file}-reencoded.wasm"), &wasm2);
if wasm != wasm2 {
panic!("failed to roundtrip through text printing");
Expand Down

0 comments on commit 29da207

Please sign in to comment.