Skip to content

Commit 58900b6

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 b102719 commit 58900b6

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
@@ -371,7 +371,10 @@ fn host_function_error() -> Result<()> {
371371
let res = init_sandbox
372372
.call::<i32>("GuestMethod1", msg.to_string())
373373
.unwrap_err();
374-
assert!(matches!(res, HyperlightError::Error(msg) if msg == "Host function error!"));
374+
assert!(
375+
matches!(&res, HyperlightError::GuestError(_, msg) if msg == "Host function error!") // rust guest
376+
|| matches!(&res, HyperlightError::GuestAborted(_, msg) if msg.contains("Host function error!")) // c guest
377+
);
375378
}
376379
}
377380
Ok(())

0 commit comments

Comments
 (0)