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

Function test_watcher_as_trait_object

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

Source from the content-addressed store, hash-verified

848
849 #[tokio::test]
850 async fn test_watcher_as_trait_object() {
851 let dir = TempDir::new().unwrap();
852 let config = make_config(&dir);
853 let mut watcher: Box<dyn FileWatcher> = Box::new(FallbackWatcher::new(config));
854
855 assert!(!watcher.is_active());
856 watcher.begin_turn("sess-1").await.unwrap();
857 assert!(watcher.is_active());
858
859 fs::write(dir.path().join("test.rs"), "test code").unwrap();
860
861 let changes = watcher.end_turn().await.unwrap();
862 assert_eq!(changes.file_count(), 1);
863 assert!(!watcher.is_active());
864 }
865}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected