Skip to content

Commit ef2a09e

Browse files
committed
Fix up test to work with new error handling
Update sandbox_host_tests.rs to use the new Result-like error handling pattern. Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent b1a4689 commit ef2a09e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hyperlight_host/tests/sandbox_host_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,10 @@ fn host_function_error() -> Result<()> {
369369
let res = init_sandbox
370370
.call::<i32>("GuestMethod1", msg.to_string())
371371
.unwrap_err();
372-
assert!(matches!(res, HyperlightError::Error(msg) if msg == "Host function error!"));
372+
assert!(
373+
matches!(&res, HyperlightError::GuestError(_, msg) if msg == "Host function error!") // rust guest
374+
|| matches!(&res, HyperlightError::GuestAborted(_, msg) if msg.contains("Host function error!")) // c guest
375+
);
373376
}
374377
Ok(())
375378
}

0 commit comments

Comments
 (0)