diff --git a/src/utils/files.rs b/src/utils/files.rs index 5a5b067..0f1b33c 100644 --- a/src/utils/files.rs +++ b/src/utils/files.rs @@ -118,22 +118,26 @@ pub async fn check_file(filename: &str, path: &str) -> Result<(), CustomError> { #[cfg(test)] -mod files_unittest { +mod files_unittests { use super::*; - #[test] - fn try_to_create_watcher() { - + #[tokio::test] + async fn try_to_create_watcher() { + let res = create_watcher("dep-file", "/home/user/monitor/runner-rs/tests/examples/").await; + assert!(res.is_ok()); } - #[test] - fn try_to_create_invalid_watcher() { - + #[tokio::test] + async fn try_to_create_invalid_watcher() { + let res = create_watcher("invalid-file", "/path/to/the/hell").await; + assert!(res.is_err()); } - #[test] - fn check_existing_file() { - + #[tokio::test] + async fn check_existing_file() { + let res = check_file("dep-file", "/home/user/monitor/runner-rs/tests/examples/").await; + assert!(res.is_ok()); } - #[test] - fn check_non_existing_file() { - + #[tokio::test] + async fn check_non_existing_file() { + let res = check_file("invalid-file", "/path/to/the/hell").await; + assert!(res.is_err()); } } \ No newline at end of file