mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Refactor tests.
This commit is contained in:
parent
202f8829b6
commit
97ec031c52
1 changed files with 25 additions and 26 deletions
|
@ -52,9 +52,9 @@ class TaskManagerTest @Inject constructor(val taskManager: TaskManager) {
|
||||||
Assert.assertEquals(runCompileTasks(listOf("clean")), listOf("clean", "copyVersion"))
|
Assert.assertEquals(runCompileTasks(listOf("clean")), listOf("clean", "copyVersion"))
|
||||||
Assert.assertEquals(runCompileTasks(listOf("clean", "compile")), listOf("clean", "compile", "copyVersion",
|
Assert.assertEquals(runCompileTasks(listOf("clean", "compile")), listOf("clean", "compile", "copyVersion",
|
||||||
"postCompile"))
|
"postCompile"))
|
||||||
Assert.assertEquals(runCompileTasks(listOf("assemble")), listOf("compile", "assemble"))
|
Assert.assertEquals(runCompileTasks(listOf("assemble")), listOf("compile", "assemble", "postCompile"))
|
||||||
Assert.assertEquals(runCompileTasks(listOf("clean", "assemble")), listOf("clean", "compile", "assemble",
|
Assert.assertEquals(runCompileTasks(listOf("clean", "assemble")), listOf("clean", "compile", "assemble",
|
||||||
"copyVersion"))
|
"copyVersion", "postCompile"))
|
||||||
}
|
}
|
||||||
|
|
||||||
val EMPTY_MULTI_MAP = ArrayListMultimap.create<String, String>()
|
val EMPTY_MULTI_MAP = ArrayListMultimap.create<String, String>()
|
||||||
|
@ -84,58 +84,57 @@ class TaskManagerTest @Inject constructor(val taskManager: TaskManager) {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun exampleInTheDocTest() {
|
fun exampleInTheDocTest() {
|
||||||
runTasks(listOf("compile"),
|
Assert.assertEquals(runTasks(listOf("compile"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
},
|
},
|
||||||
reverseDependsOn = TreeMultimap.create<String, String>().apply {
|
reverseDependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "compile", "example"))
|
listOf("clean", "compile", "example"))
|
||||||
}
|
|
||||||
runTasks(listOf("compile"),
|
Assert.assertEquals(runTasks(listOf("compile"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "example", "compile"))
|
listOf("clean", "example", "compile"))
|
||||||
}
|
|
||||||
runTasks(listOf("compile"),
|
Assert.assertEquals(runTasks(listOf("compile"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
},
|
},
|
||||||
runAfter = TreeMultimap.create<String, String>().apply {
|
runAfter = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "compile"))
|
listOf("clean", "compile"))
|
||||||
}
|
|
||||||
runTasks(listOf("compile"),
|
Assert.assertEquals(runTasks(listOf("compile"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
},
|
},
|
||||||
runBefore = TreeMultimap.create<String, String>().apply {
|
runBefore = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "compile"))
|
listOf("clean", "compile"))
|
||||||
}
|
|
||||||
runTasks(listOf("compile", "example"),
|
Assert.assertEquals(runTasks(listOf("compile", "example"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
},
|
},
|
||||||
runBefore = TreeMultimap.create<String, String>().apply {
|
runBefore = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "example", "compile"))
|
listOf("clean", "example", "compile"))
|
||||||
}
|
|
||||||
runTasks(listOf("compile", "example"),
|
Assert.assertEquals(runTasks(listOf("compile", "example"),
|
||||||
dependsOn = TreeMultimap.create<String, String>().apply {
|
dependsOn = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "clean")
|
put("compile", "clean")
|
||||||
},
|
},
|
||||||
runAfter = TreeMultimap.create<String, String>().apply {
|
runAfter = TreeMultimap.create<String, String>().apply {
|
||||||
put("compile", "example")
|
put("compile", "example")
|
||||||
}).let { result ->
|
}),
|
||||||
Assert.assertEquals(result, listOf("clean", "compile", "example"))
|
listOf("clean", "compile", "example"))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue