()
| 289 | |
| 290 | #[test] |
| 291 | fn test_watched_paths() { |
| 292 | let temp_dir = TempDir::new().unwrap(); |
| 293 | let watcher = FileWatcher::new(WatcherConfig::default()).unwrap(); |
| 294 | |
| 295 | assert!(watcher.watched_paths().is_empty()); |
| 296 | assert!(!watcher.is_watching(temp_dir.path())); |
| 297 | |
| 298 | watcher.watch(temp_dir.path()).unwrap(); |
| 299 | |
| 300 | assert_eq!(watcher.watched_paths().len(), 1); |
| 301 | assert!(watcher.is_watching(temp_dir.path())); |
| 302 | } |
| 303 | } |