test: Fix test_spawn_watcher_invalid_path to catch expected panic
This commit is contained in:
1 parent
2024d9521b
commit
827f0dd511
1 file changed
+3
@@ -237,7 +237,10 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_spawn_watcher_invalid_path() {
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user