1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Added command "/v1/getDependencyGraph" for the IDEA plug-in.

This commit is contained in:
Cedric Beust 2016-07-31 23:11:26 -08:00
parent 5577c47185
commit c0b685a044
8 changed files with 232 additions and 35 deletions

View file

@ -185,4 +185,23 @@ class DynamicGraphTest {
}
}
@Test
fun transitiveClosureGraphTest() {
val graph = DynamicGraph<String>().apply {
// a -> b
// b -> c, d
// e
addEdge("a", "b")
addEdge("b", "c")
addEdge("b", "d")
addNode("e")
}
val closure = DynamicGraph.transitiveClosureGraph("a", { s -> graph.childrenOf(s).toList() } )
assertThat(closure.value).isEqualTo("a")
val ca = closure.children
assertThat(ca.map { it.value }).isEqualTo(listOf("b"))
val cb = ca[0].children
assertThat(cb.map { it.value }).isEqualTo(listOf("d", "c"))
}
}