mihaibudiu commented on code in PR #4393:
URL: https://github.com/apache/calcite/pull/4393#discussion_r2098602160
##########
core/src/test/java/org/apache/calcite/util/graph/DirectedGraphTest.java:
##########
@@ -172,6 +174,19 @@ private <V> List<List<V>> paths(DirectedGraph<V,
DefaultEdge> g,
assertThat(list, hasToString("[A, B, E, C, F, D]"));
}
+ /**
+ * Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-7030">[CALCITE-7030]
+ * Enhance TopologicalOrderIterator to support BOTTOM_UP</a>. */
+ @Test void testTopologicalOrderWithBottomUpIterator() {
+ final DefaultDirectedGraph<String, DefaultEdge> graph = createDag();
+ final List<String> list = new ArrayList<>();
+ for (String s : TopologicalOrderIterator.of(graph,
HepMatchOrder.BOTTOM_UP)) {
+ list.add(s);
+ }
+ assertThat(list, hasToString("[D, F, C, B, E, A]"));
Review Comment:
in general a graph has multiple topological orders, is the result here
deterministic?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]