()
| 87 | |
| 88 | #[test] |
| 89 | fn acyclic_sp() { |
| 90 | let i = TINY_EWDAG; |
| 91 | let graph = create_graph(i); |
| 92 | let sp = AcyclicSP::new(graph.as_ref(), 5).unwrap(); |
| 93 | for (i, (weight, size)) in vec![ |
| 94 | (0.73, 2), // (dist_to(i), path_to(i).len()) |
| 95 | (0.32, 1), |
| 96 | (0.62, 2), |
| 97 | (0.61, 2), |
| 98 | (0.35, 1), |
| 99 | (0.0, 0), |
| 100 | (1.13, 3), |
| 101 | (0.28, 1), |
| 102 | ] |
| 103 | .iter() |
| 104 | .enumerate() |
| 105 | { |
| 106 | assert_eq!(*size, sp.path_to(i).map_or(0, |path| path.len())); |
| 107 | assert_relative_eq!(*weight, sp.dist_to(i)); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | #[test] |
| 112 | fn acyclic_lp() { |
nothing calls this directly
no test coverage detected