()
| 153 | |
| 154 | #[test] |
| 155 | fn progress_reporter_lifecycle() { |
| 156 | let mut reporter = ProgressReporter::new(GraphAlgorithm::PageRank, 20, Some(1e-7), 1000); |
| 157 | |
| 158 | reporter.report_iteration(1, Some(0.5)); |
| 159 | reporter.report_iteration(2, Some(0.01)); |
| 160 | reporter.report_iteration(3, Some(1e-8)); |
| 161 | |
| 162 | let snap = reporter.snapshot(3); |
| 163 | assert!(snap.converged); |
| 164 | assert_eq!(snap.algorithm, GraphAlgorithm::PageRank); |
| 165 | assert_eq!(snap.max_iterations, 20); |
| 166 | assert_eq!(snap.nodes_processed, 1000); |
| 167 | |
| 168 | reporter.finish(); |
| 169 | } |
| 170 | |
| 171 | #[test] |
| 172 | fn progress_non_iterative() { |
nothing calls this directly
no test coverage detected