liyafan82 commented on a change in pull request #2027:
URL: https://github.com/apache/calcite/pull/2027#discussion_r446590442



##########
File path: 
core/src/test/java/org/apache/calcite/util/graph/DirectedGraphTest.java
##########
@@ -64,14 +64,21 @@
     g.addEdge("B", "D");
     assertEquals("[A, B, D]", shortestPath(g, "A", "D").toString());
     assertNull(shortestPath(g, "A", "E"), "There is no path from A to E");
-    assertEquals("[]", shortestPath(g, "D", "D").toString());
+    assertEquals("[D, C, D]", shortestPath(g, "D", "D").toString());

Review comment:
       Sounds reasonable. I have revised the code to include the empty path to 
itself.
   
   BTW, the empty path from node D to itself should be denoted "[D]"? as it 
helps to maintain the relation:
   
   pathLength == path.size() - 1




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to