mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log][linear-bek] add a couple of tests
This commit is contained in:
+25
-1
@@ -19,7 +19,6 @@ import com.intellij.vcs.log.graph.TestGraphBuilder
|
||||
import com.intellij.vcs.log.graph.api.elements.GraphEdge
|
||||
import com.intellij.vcs.log.graph.api.elements.GraphEdgeType
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class LinearBekExpandTest {
|
||||
fun runTest(beforeLinearBekBuilder: TestGraphBuilder.() -> Unit, afterExpansionBuilder: TestGraphBuilder.() -> Unit, fromNodeToExpand: Int, toNodeToExpand: Int) {
|
||||
@@ -146,4 +145,29 @@ class LinearBekExpandTest {
|
||||
9()
|
||||
}, afterLinearBek)
|
||||
}
|
||||
|
||||
/*
|
||||
0
|
||||
|\
|
||||
| 1
|
||||
| |\
|
||||
|/ 2
|
||||
3 /
|
||||
|/
|
||||
4
|
||||
*/
|
||||
Test fun replaceDottedEdgeTest() {
|
||||
val builder: TestGraphBuilder.() -> Unit = {
|
||||
0(3, 1)
|
||||
1(3, 2)
|
||||
2(4)
|
||||
3(4)
|
||||
4()
|
||||
}
|
||||
val afterLinearBek = runLinearBek(builder)
|
||||
|
||||
afterLinearBek.expandEdge(GraphEdge.createNormalEdge(2, 3, GraphEdgeType.DOTTED))
|
||||
|
||||
assertEquals(builder, afterLinearBek)
|
||||
}
|
||||
}
|
||||
@@ -615,4 +615,33 @@ class LinearBekTest {
|
||||
5(6.dot)
|
||||
6()
|
||||
})
|
||||
|
||||
/*
|
||||
0 0
|
||||
|\ |
|
||||
| 1 1
|
||||
| |\ |\
|
||||
| | 2 | 2
|
||||
| 3 | --> 3 :
|
||||
| \' : :
|
||||
|/| :'
|
||||
4 | 4
|
||||
|/ |
|
||||
5 5
|
||||
*/
|
||||
Test fun crossedTailsTest() = runTest({
|
||||
0(4, 1)
|
||||
1(3, 2)
|
||||
2(4)
|
||||
3(5)
|
||||
4(5)
|
||||
5()
|
||||
}, {
|
||||
0(1)
|
||||
1(3, 2)
|
||||
2(4.dot)
|
||||
3(4.dot)
|
||||
4(5)
|
||||
5()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user