Skip to content

Commit

Permalink
add error message verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazuki Massaki authored and Kazuki Massaki committed Dec 4, 2024
1 parent 8b697ea commit 52dfb64
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 52dfb64

Please sign in to comment.