diff --git a/tests/digraph/t0_fewnodes.nim b/tests/digraph/t0_fewnodes.nim index f8bfe6a..cd05b9d 100644 --- a/tests/digraph/t0_fewnodes.nim +++ b/tests/digraph/t0_fewnodes.nim @@ -3,9 +3,10 @@ discard """ action: "run" batchable: true joinable: true - timeout: 2.0 + timeout: 10.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ import diff --git a/tests/digraph/t1_manynodes.nim b/tests/digraph/t1_manynodes.nim index 839c51a..343b663 100644 --- a/tests/digraph/t1_manynodes.nim +++ b/tests/digraph/t1_manynodes.nim @@ -3,9 +3,10 @@ discard """ action: "run" batchable: true joinable: true - timeout: 20.0 + timeout: 40.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ import diff --git a/tests/digraph/t2_cycles.nim b/tests/digraph/t2_cycles.nim index 11d68e0..4ac8c32 100644 --- a/tests/digraph/t2_cycles.nim +++ b/tests/digraph/t2_cycles.nim @@ -3,9 +3,10 @@ discard """ action: "run" batchable: true joinable: true - timeout: 2.0 + timeout: 10.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ ##[This test verifies that the cycle detection algorithms correctly identify @@ -46,7 +47,33 @@ block simple: doAssert myDig.hasTwoCycle(Kahns) doAssert myDig.hasTwoCycle(PathBasedStrongComponent) +block loop: + var myDig = DiGraph[int]() + with myDig: + inclEdge 1, 2 + inclEdge 2, 3 + inclEdge 3, 4 + inclEdge 4, 5 + + inclEdge 3, 5 + + inclEdge 10, 2 + + inclEdge 55, 2 + # Verify that the graph currently has no cycles + doAssert not myDig.hasCycle + doAssert not myDig.hasLoop + doAssert not myDig.hasTwoCycle(Kahns) + doAssert not myDig.hasTwoCycle(PathBasedStrongComponent) + + myDig.inclEdge 5, 5 # Add an edge from node 5 to node 5, creating a loop + + # Verify that the graph now contains a cycle + doAssert myDig.hasCycle + doAssert not myDig.hasTwoCycle(Kahns) + doAssert not myDig.hasTwoCycle(PathBasedStrongComponent) + doAssert myDig.hasLoop block complex: var complexDigraph = DiGraph[int]() diff --git a/tests/digraph/t3_simpleIterators.nim b/tests/digraph/t3_simpleIterators.nim index ead33b5..1babaff 100644 --- a/tests/digraph/t3_simpleIterators.nim +++ b/tests/digraph/t3_simpleIterators.nim @@ -5,7 +5,8 @@ discard """ joinable: true timeout: 2.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ import diff --git a/tests/digraph/t4_walkFrom.nim b/tests/digraph/t4_walkFrom.nim index 1d63430..c5d21ba 100644 --- a/tests/digraph/t4_walkFrom.nim +++ b/tests/digraph/t4_walkFrom.nim @@ -5,7 +5,8 @@ discard """ joinable: true timeout: 5.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ import diff --git a/tests/digraph/t5_properties.nim b/tests/digraph/t5_properties.nim index b9531c9..dd82319 100644 --- a/tests/digraph/t5_properties.nim +++ b/tests/digraph/t5_properties.nim @@ -5,7 +5,8 @@ discard """ joinable: true timeout: 5.0 targets: "c cpp js objc" - matrix: "; -d:release; -d:danger" + valgrind: on + matrix: "-d:useMalloc" """ import diff --git a/tests/unsafetables/tests.nim b/tests/unsafetables/tests.nim index d8908a2..d43ccde 100644 --- a/tests/unsafetables/tests.nim +++ b/tests/unsafetables/tests.nim @@ -5,7 +5,8 @@ discard """ joinable: true timeout: 2.0 targets: "c cpp js objc" - matrix: "" + valgrind: on + matrix: "-d:useMalloc" """ import