[vcs-log][linear-bek] add a couple of tests

This commit is contained in:
Julia Beliaeva
2015-02-13 15:52:13 +03:00
parent fb1212ef7a
commit 6603cd1064
2 changed files with 54 additions and 1 deletions
@@ -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()
})
}