mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 09:32:49 +00:00
Fixing unit tests for MacOS
This commit is contained in:
parent
4638f104be
commit
6b17409a72
|
@ -8,7 +8,6 @@ use notify::{
|
|||
event::{CreateKind, DataChange, ModifyKind, RenameMode},
|
||||
Event, EventKind,
|
||||
};
|
||||
use tokio::{fs, io};
|
||||
use tracing::trace;
|
||||
|
||||
use super::{
|
||||
|
|
|
@ -333,7 +333,10 @@ mod tests {
|
|||
Config, Event, EventKind, RecommendedWatcher, Watcher,
|
||||
};
|
||||
use std::io::ErrorKind;
|
||||
use std::{path::Path, time::Duration};
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
time::Duration,
|
||||
};
|
||||
use tempfile::{tempdir, TempDir};
|
||||
use tokio::{fs, io::AsyncWriteExt, sync::mpsc, time::sleep};
|
||||
use tracing::{debug, error};
|
||||
|
@ -375,8 +378,10 @@ mod tests {
|
|||
Ok(maybe_event) => {
|
||||
let event = maybe_event.expect("Failed to receive event");
|
||||
debug!("Received event: {event:#?}");
|
||||
// Using `ends_with` here due to a weird edge case on CI tests at MacOS
|
||||
if event.paths[0].ends_with(path) && event.kind == expected_event {
|
||||
// Using `ends_with` and removing root path here due to a weird edge case on CI tests at MacOS
|
||||
if event.paths[0].ends_with(path.iter().skip(1).collect::<PathBuf>())
|
||||
&& event.kind == expected_event
|
||||
{
|
||||
debug!("Received expected event: {expected_event:#?}");
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue