()
| 970 | |
| 971 | #[tokio::test] |
| 972 | async 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 |
nothing calls this directly
no test coverage detected