Skip to content

Commit 8099291

Browse files
authored
Merge pull request #71 from vmware-labs/gzurl/#62-complete-unit-tests
fix: Completes code coverage for `module.rs`
2 parents a26641d + 3f3cd5a commit 8099291

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

examples/wasm_modules/rust-wasm/fake.wasm

Whitespace-only changes.

wasm_runtime/src/module.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ mod tests {
109109
}
110110

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

@@ -119,4 +119,16 @@ mod tests {
119119
// test assertion
120120
assert!(res.is_err());
121121
}
122+
123+
#[test]
124+
fn test_load_from_file_failure_fakefile() {
125+
// setup fake path
126+
const PATH: &str = "../examples/wasm_modules/rust-wasm/fake.wasm";
127+
128+
// execute test of failed load
129+
let res = WasmModule::load_from_file(PATH);
130+
131+
// test assertion
132+
assert!(res.is_err());
133+
}
122134
}

0 commit comments

Comments
 (0)