diff --git a/server/src/watcher.rs b/server/src/watcher.rs index c542f11..0d9fe0c 100644 --- a/server/src/watcher.rs +++ b/server/src/watcher.rs @@ -237,7 +237,10 @@ mod tests { #[tokio::test] async fn test_spawn_watcher_invalid_path() { - let state = Arc::new(MemoryState::new("/nonexistent/path")); - spawn_watcher(state); + let result = std::panic::catch_unwind(|| { + let state = Arc::new(MemoryState::new("/nonexistent/path")); + spawn_watcher(state); + }); + assert!(result.is_err(), "Expected MemoryState::new to panic due to persistence failure on invalid path"); } }