From ad335784fe8fe05bf400cf16d8ca52364ad2d001 Mon Sep 17 00:00:00 2001 From: KennyMcCormick Date: Wed, 16 Apr 2025 20:53:27 +0800 Subject: [PATCH] fix: modify ut logic which is incorrect under macOS (#1099) Signed-off-by: cormick --- dragonfly-client-backend/src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dragonfly-client-backend/src/lib.rs b/dragonfly-client-backend/src/lib.rs index 934b6faf..551e018e 100644 --- a/dragonfly-client-backend/src/lib.rs +++ b/dragonfly-client-backend/src/lib.rs @@ -436,9 +436,15 @@ mod tests { let result = BackendFactory::new(Some(&plugin_dir)); assert!(result.is_err()); - assert_eq!( - format!("{}", result.err().unwrap()), - format!("PluginError cause: {}: file too short", lib_path.display()), + let err_msg = format!("{}", result.err().unwrap()); + + assert!( + err_msg.starts_with("PluginError cause:"), + "error message should start with 'PluginError cause:'" + ); + assert!( + err_msg.contains(&lib_path.display().to_string()), + "error message should contain library path" ); }