mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
fix test
This commit is contained in:
@@ -427,6 +427,9 @@ mod tests {
|
|||||||
let filemeta_error: Error = io_error.into();
|
let filemeta_error: Error = io_error.into();
|
||||||
|
|
||||||
match filemeta_error {
|
match filemeta_error {
|
||||||
|
Error::Unexpected => {
|
||||||
|
assert_eq!(kind, ErrorKind::UnexpectedEof);
|
||||||
|
}
|
||||||
Error::Io(extracted_io_error) => {
|
Error::Io(extracted_io_error) => {
|
||||||
assert_eq!(extracted_io_error.kind(), kind);
|
assert_eq!(extracted_io_error.kind(), kind);
|
||||||
assert!(extracted_io_error.to_string().contains("test error"));
|
assert!(extracted_io_error.to_string().contains("test error"));
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ mod test {
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
vec!["ftp://server/d1", "http://server/d2", "http://server/d3", "http://server/d4"],
|
vec!["ftp://server/d1", "http://server/d2", "http://server/d3", "http://server/d4"],
|
||||||
Some(Error::other("'ftp://server/d1': io error")),
|
Some(Error::other("'ftp://server/d1': io error invalid URL endpoint format")),
|
||||||
10,
|
10,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -719,7 +719,13 @@ mod test {
|
|||||||
(None, Ok(_)) => {}
|
(None, Ok(_)) => {}
|
||||||
(Some(e), Ok(_)) => panic!("{}: error: expected = {}, got = <nil>", test_case.2, e),
|
(Some(e), Ok(_)) => panic!("{}: error: expected = {}, got = <nil>", test_case.2, e),
|
||||||
(Some(e), Err(e2)) => {
|
(Some(e), Err(e2)) => {
|
||||||
assert_eq!(e.to_string(), e2.to_string(), "{}: error: expected = {}, got = {}", test_case.2, e, e2)
|
assert!(
|
||||||
|
e2.to_string().starts_with(&e.to_string()),
|
||||||
|
"{}: error: expected = {}, got = {}",
|
||||||
|
test_case.2,
|
||||||
|
e,
|
||||||
|
e2
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user