Skip to content

Commit

Permalink
Merge pull request #71 from vmware-labs/gzurl/#62-complete-unit-tests
Browse files Browse the repository at this point in the history
fix: Completes code coverage for `module.rs`
  • Loading branch information
gzurl authored Jan 26, 2024
2 parents a26641d + 3f3cd5a commit 8099291
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Empty file.
14 changes: 13 additions & 1 deletion wasm_runtime/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod tests {
}

#[test]
fn test_load_from_file_failure() {
fn test_load_from_file_failure_nonexistent() {
// setup non-existent path
const PATH: &str = "../attempt/to/load/me.wasm";

Expand All @@ -119,4 +119,16 @@ mod tests {
// test assertion
assert!(res.is_err());
}

#[test]
fn test_load_from_file_failure_fakefile() {
// setup fake path
const PATH: &str = "../examples/wasm_modules/rust-wasm/fake.wasm";

// execute test of failed load
let res = WasmModule::load_from_file(PATH);

// test assertion
assert!(res.is_err());
}
}

0 comments on commit 8099291

Please sign in to comment.