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

Fix task ordering bug.

Fixes https://github.com/cbeust/kobalt/issues/276
This commit is contained in:
Cedric Beust 2016-07-11 23:35:03 -08:00
parent 1ec704e297
commit 4a1fbf2f9c
2 changed files with 22 additions and 4 deletions

View file

@ -101,12 +101,19 @@ class BuildOrderTest @Inject constructor(val taskManager: TaskManager) {
}
}
@Test
fun shouldBuildInRightOrder3() {
@DataProvider
fun tasks3(): Array<Array<out Any>> {
return arrayOf(
arrayOf(listOf("exec", "run"), listOf("p1:exec", "p1:run")),
arrayOf(listOf("run", "exec"), listOf("p1:run", "p1:exec"))
)
}
@Test(dataProvider = "tasks3")
fun shouldBuildInRightOrder3(tasks: List<String>, expectedTasks: List<String>) {
val p1 = project { name = "p1" }
val expectedTasks = listOf("p1:run", "p1:exec")
with(taskManager) {
with(calculateDependentTaskNames(listOf("run", "exec"), listOf(p1))) {
with(calculateDependentTaskNames(tasks, listOf(p1))) {
assertThat(this.map { it.id }).isEqualTo(expectedTasks)
}
}