MCPcopy
hub / github.com/Col-E/Recaf / testDirectedPathSearch

Method testDirectedPathSearch

src/test/java/me/coley/recaf/GraphTest.java:90–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 @Test
91 public void testDirectedPathSearch() {
92 IVert v1 = directedGraph.getVertex(1);
93 for(int i = 2; i < 5; i++) {
94 IVert vOther = directedGraph.getVertex(i);
95 // Use DFS to find the path between v1 and vOther
96 Search<Integer> search = new DepthFirstSearch<>();
97 SearchResult<Integer> result = search.find(v1, vOther);
98 assertNotNull(result);
99 }
100 IVert v5 = directedGraph.getVertex(5);
101 for(int i = 1; i < 4; i++) {
102 IVert vOther = directedGraph.getVertex(i);
103 // Use DFS to ensure no path exists between v5 and vOther
104 Search<Integer> search = new DepthFirstSearch<>();
105 SearchResult<Integer> result = search.find(v5, vOther);
106 assertNull(result);
107 }
108 }
109
110 @Test
111 public void testDirectedChildren() {

Callers

nothing calls this directly

Calls 2

findMethod · 0.95
getVertexMethod · 0.65

Tested by

no test coverage detected