()
| 100 | |
| 101 | #[test] |
| 102 | fn cycle() { |
| 103 | let graph = create_digraph(TINY_DG); |
| 104 | let cycle = DirectedCycle::from(graph.as_ref()); |
| 105 | assert!(cycle.has_cycle()); |
| 106 | assert!(cycle.cycle().unwrap().eq(vec![3, 5, 4, 3].iter())); |
| 107 | assert!(cycle.check().is_ok()); |
| 108 | |
| 109 | //DAG |
| 110 | let graph = create_digraph(TINY_DAG); |
| 111 | let cycle = DirectedCycle::from(graph.as_ref()); |
| 112 | assert!(!cycle.has_cycle()); |
| 113 | assert!(cycle.cycle().is_none()); |
| 114 | assert!(cycle.check().is_ok()); |
| 115 | } |
| 116 | |
| 117 | #[test] |
| 118 | fn topological() { |
nothing calls this directly
no test coverage detected