Skip to content

Commit

Permalink
add error message verification
Browse files Browse the repository at this point in the history
Signed-off-by: Kazuki Massaki <[email protected]>
Signed-off-by: kazuki.massaki <[email protected]>
  • Loading branch information
Kazuki Massaki authored and kazmsk committed Dec 8, 2024
1 parent 8372fa9 commit 841a685
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ fn create_spec() -> Result<Spec> {
fn process_capabilities_fail_test() -> TestResult {
match create_spec() {
Result::Ok(_) => TestResult::Failed(Error::msg("create_spec succeeded unexpectedly.")),
Err(_e) => TestResult::Passed,
Err(e) => {
if e.to_string() == "invalid capability" {
TestResult::Passed
} else {
TestResult::Failed(Error::msg(format!("unexpected error: {}", e)))
}
}
}
}

Expand Down

0 comments on commit 841a685

Please sign in to comment.