Explicitly test for disallowed self-cycles

This commit is contained in:
2022-05-02 20:00:59 +02:00
parent 8926af4e13
commit ea8e0208a0

View File

@@ -226,6 +226,14 @@ mod tests {
use super::*;
#[test]
fn test_no_self_cycle() {
// Regression test for https://github.com/bertptrs/tracing-mutex/issues/7
let mut graph = DiGraph::default();
assert!(!graph.add_edge(1, 1));
}
#[test]
fn test_digraph() {
let mut graph = DiGraph::default();