diff --git a/lyra-resource/src/resource_manager.rs b/lyra-resource/src/resource_manager.rs index dcf7e8b..6b84686 100644 --- a/lyra-resource/src/resource_manager.rs +++ b/lyra-resource/src/resource_manager.rs @@ -237,6 +237,7 @@ impl ResourceManager { let path = resource.path(); if let Some(loader) = self.loaders.iter() .find(|l| l.does_support_file(&path)) { + println!("got loader"); let loader = Arc::clone(loader); // stop borrowing from self let loaded = loader.load(self, &path)?; let loaded = loaded.as_arc_any(); @@ -325,6 +326,7 @@ mod tests { let img = res.try_data_ref(); img.unwrap(); + println!("Path = {}", res.path()); man.reload(res.clone()).unwrap(); assert_eq!(res.version(), 1); @@ -334,8 +336,9 @@ mod tests { #[test] fn watch_image() { - let image_path = get_image("squiggles.png"); - let image_bytes = std::fs::read(&image_path).unwrap(); + let orig_path = get_image("squiggles.png"); + let image_path = get_image("squiggles_test.png"); + std::fs::copy(orig_path, &image_path).unwrap(); let mut man = ResourceManager::new(); let res = man.request::(&image_path).unwrap(); @@ -350,8 +353,6 @@ mod tests { let event = recv.recv().unwrap(); let event = event.unwrap(); - std::fs::write(image_path, image_bytes).unwrap(); - assert!(event.iter().any(|ev| ev.kind.is_remove() || ev.kind.is_modify())); } } \ No newline at end of file