We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dff0289 commit d46f753Copy full SHA for d46f753
src/file_path.test.rs
@@ -1,3 +1,4 @@
1
+use crate::assert_error;
2
use crate::file_path::FilePath;
3
4
#[test]
@@ -17,12 +18,9 @@ fn when_parsing_file_path_to_non_existing_file_then_return_no_such_file_error()
17
18
"/nonexistent/../path/../file.log",
19
];
20
for path in paths {
- match FilePath::from(path) {
21
- Ok(_) => panic!("Error was expected"),
22
- Err(error) => assert_eq!(
23
- error.to_string(),
24
- "Error parsing directory path: No such file or directory (os error 2)"
25
- ),
26
- };
+ assert_error!(
+ FilePath::from(path),
+ "Error parsing directory path: No such file or directory (os error 2)"
+ );
27
}
28
0 commit comments