fix: modify ut logic which is incorrect under macOS (#1099)

Signed-off-by: cormick <cormick1080@gmail.com>
This commit is contained in:
KennyMcCormick 2025-04-16 20:53:27 +08:00 committed by GitHub
parent cfab09f4c0
commit ad335784fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

View File

@ -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"
);
}