MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_build_file_adjacency

Function test_build_file_adjacency

tests/graph_suite/graph_test.rs:972–991  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

970
971#[tokio::test]
972async fn test_build_file_adjacency() {
973 let (cg, _dir) = setup_project().await;
974 let qm = GraphQueryManager::new(cg.db());
975 let adj = qm.build_file_adjacency(None).await.unwrap();
976
977 // src/main.rs depends on src/utils.rs (calls helper)
978 assert!(
979 adj.get("src/main.rs")
980 .is_some_and(|deps| deps.contains("src/utils.rs")),
981 "main.rs should depend on utils.rs"
982 );
983
984 // Self-edges should be excluded
985 for (file, deps) in &adj {
986 assert!(
987 !deps.contains(file),
988 "file {file} should not have a self-edge"
989 );
990 }
991}
992
993// ---------------------------------------------------------------------------
994// Health algorithm tests

Callers

nothing calls this directly

Calls 3

build_file_adjacencyMethod · 0.80
setup_projectFunction · 0.70
dbMethod · 0.45

Tested by

no test coverage detected