test: Fix test_spawn_watcher_invalid_path to catch expected panic

This commit is contained in:
Riz Ashraf committed 2026-10-10 20:27:08 +01:00
1 parent 2024d9521b
commit 827f0dd511
1 file changed
+3
+3
View File
@@ -237,7 +237,10 @@ mod tests {
#[tokio::test] #[tokio::test]
async fn test_spawn_watcher_invalid_path() { async fn test_spawn_watcher_invalid_path() {
let result = std::panic::catch_unwind(|| {
let state = Arc::new(MemoryState::new("/nonexistent/path")); let state = Arc::new(MemoryState::new("/nonexistent/path"));
spawn_watcher(state); spawn_watcher(state);
});
assert!(result.is_err(), "Expected MemoryState::new to panic due to persistence failure on invalid path");
} }
} }