Skip to content

Commit 89078f1

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 8443034 commit 89078f1

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
@@ -356,7 +356,10 @@ fn host_function_error() -> Result<()> {
356356
let res = init_sandbox
357357
.call::<i32>("GuestMethod1", msg.to_string())
358358
.unwrap_err();
359-
assert!(matches!(res, HyperlightError::Error(msg) if msg == "Host function error!"));
359+
assert!(
360+
matches!(&res, HyperlightError::GuestError(_, msg) if msg == "Host function error!") // rust guest
361+
|| matches!(&res, HyperlightError::GuestAborted(_, msg) if msg.contains("Host function error!")) // c guest
362+
);
360363
}
361364
}
362365
Ok(())

0 commit comments

Comments
 (0)