From 841a6851ba76393ff22cc8cb96fc9eb80e566b37 Mon Sep 17 00:00:00 2001 From: Kazuki Massaki Date: Wed, 4 Dec 2024 14:28:51 +0900 Subject: [PATCH] add error message verification Signed-off-by: Kazuki Massaki Signed-off-by: kazuki.massaki --- .../process_capabilities_fail_test.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/contest/contest/src/tests/process_capabilities_fail/process_capabilities_fail_test.rs b/tests/contest/contest/src/tests/process_capabilities_fail/process_capabilities_fail_test.rs index 9f8d288d0..89864aa99 100644 --- a/tests/contest/contest/src/tests/process_capabilities_fail/process_capabilities_fail_test.rs +++ b/tests/contest/contest/src/tests/process_capabilities_fail/process_capabilities_fail_test.rs @@ -31,7 +31,13 @@ fn create_spec() -> Result { 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))) + } + } } }