Skip to content

Commit db414fd

Browse files
committed
Fix bonjour test
1 parent bd7f941 commit db414fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

zeroconf/src/bonjour/bonjour_util.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn sys_exec<F: FnOnce() -> DNSServiceErrorType>(func: F, message: &str) -> R
5050
if err < 0 {
5151
Err(Error::MdnsSystemError {
5252
code: err,
53-
message: message.into(),
53+
message: format!("{} (code: {})", message, err).into(),
5454
})
5555
} else {
5656
Ok(())
@@ -136,9 +136,11 @@ mod tests {
136136

137137
#[test]
138138
fn sys_exec_returns_error() {
139-
let expected = Error::InvalidServiceType("uh oh spaghetti-o (code: -42)".into());
140139
let result = sys_exec(|| -42, "uh oh spaghetti-o");
141-
assert_eq!(result, Err(expected));
140+
assert_eq!(result, Err(Error::MdnsSystemError {
141+
code: -42,
142+
message: "uh oh spaghetti-o (code: -42)".into(),
143+
}));
142144
}
143145

144146
#[test]

0 commit comments

Comments
 (0)