From 5dfe6296696330eafeffb4884048ef5812a9588a Mon Sep 17 00:00:00 2001 From: HsuTing Date: Tue, 10 Mar 2026 00:36:30 +0000 Subject: [PATCH] test(process): change testing case --- src/process.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/process.rs b/src/process.rs index a6d7dfa..439f215 100644 --- a/src/process.rs +++ b/src/process.rs @@ -68,10 +68,10 @@ mod tests { let result = exec("nonexistent_command_12345", vec![]); assert!(result.is_err()); - - if let Err(ProcessError::CommandNotFound(cmd)) = result { - assert_eq!(cmd, "nonexistent_command_12345"); - } + assert!(matches!( + result.unwrap_err(), + ProcessError::CommandNotFound(..) + )); } #[test] @@ -79,9 +79,9 @@ mod tests { let result = exec_result("nonexistent_command_12345", vec![]); assert!(result.is_err()); - - if let Err(ProcessError::CommandNotFound(cmd)) = result { - assert_eq!(cmd, "nonexistent_command_12345"); - } + assert!(matches!( + result.unwrap_err(), + ProcessError::CommandNotFound(..) + )); } }