aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/graph/DiGraphTests.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/graph/DiGraphTests.scala b/src/test/scala/firrtlTests/graph/DiGraphTests.scala
index d3553a23..0771460b 100644
--- a/src/test/scala/firrtlTests/graph/DiGraphTests.scala
+++ b/src/test/scala/firrtlTests/graph/DiGraphTests.scala
@@ -150,4 +150,13 @@ class DiGraphTests extends FirrtlFlatSpec {
dotLines.exists(s => s.contains(""""d" -> "k";""")) should be (true)
dotLines.exists(s => s.contains("""rankdir="TB";""")) should be (true)
}
+
+ "reachableFrom" should "omit the queried node if no self-path exists" in {
+ degenerateGraph.reachableFrom("a") shouldBe empty
+ acyclicGraph.reachableFrom("b") should contain theSameElementsAs Vector("d", "e")
+ }
+
+ "reachableFrom" should "include the queried node if it is included in a cycle" in {
+ cyclicGraph.reachableFrom("b") should contain theSameElementsAs Vector("a", "b", "c", "d")
+ }
}