MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_watcher_detects_added_file

Function test_watcher_detects_added_file

atomic-agent/src/watcher/fallback.rs:648–661  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

646
647 #[tokio::test]
648 async fn test_watcher_detects_added_file() {
649 let dir = TempDir::new().unwrap();
650
651 let mut watcher = FallbackWatcher::new(make_config(&dir));
652 watcher.begin_turn("sess-1").await.unwrap();
653
654 // Add a file during the turn
655 fs::write(dir.path().join("new_file.rs"), "fn new() {}").unwrap();
656
657 let changes = watcher.end_turn().await.unwrap();
658 assert_eq!(changes.added, vec![PathBuf::from("new_file.rs")]);
659 assert!(changes.modified.is_empty());
660 assert!(changes.deleted.is_empty());
661 }
662
663 #[tokio::test]
664 async fn test_watcher_detects_deleted_file() {

Callers

nothing calls this directly

Calls 6

make_configFunction · 0.85
writeFunction · 0.85
unwrapMethod · 0.45
begin_turnMethod · 0.45
pathMethod · 0.45
end_turnMethod · 0.45

Tested by

no test coverage detected