test: Fix test_spawn_watcher_invalid_path to catch expected panic
This commit is contained in:
1 parent
2024d9521b
commit
827f0dd511
1 file changed
+5
-2
@@ -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 state = Arc::new(MemoryState::new("/nonexistent/path"));
|
let result = std::panic::catch_unwind(|| {
|
||||||
spawn_watcher(state);
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user