Impl PartialEq on ServerError for tests

Co-authored-by: acatangiu <adrian@parity.io>
Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
This commit is contained in:
acatangiu
2023-03-01 16:23:06 +02:00
committed by Jonathan Woollett-Light
parent 3c5d9407d3
commit 73f37d0797
2 changed files with 25 additions and 8 deletions

View File

@@ -1151,11 +1151,11 @@ mod tests {
handler.join().unwrap();
// Expect shutdown event instead of http request event.
match &*request_result.lock().unwrap() {
Err(ServerError::ShutdownEvent) => (),
v => {
panic!("Expected shutdown event, instead got {:?}.", v)
}
};
let res = request_result.lock().unwrap();
assert_eq!(
res.as_ref().unwrap_err(),
&ServerError::ShutdownEvent,
"Expected shutdown event, instead got {res:?}"
);
}
}