Ask for last good commit in bisect level
This commit is contained in:
@@ -139,6 +139,19 @@ class LevelSolutionsTest {
|
||||
"A normal commit using the current system date must not solve the commit_in_future level.",
|
||||
futureCommitExercise.validator(currentDateCommitRepo, "git commit -m \"Current date commit\""),
|
||||
)
|
||||
|
||||
val bisectExercise = bisectLevel()
|
||||
val bisectRuntime = GitRepositoryRuntime(runtimeRoot, gitBinary)
|
||||
var bisectRepo = bisectRuntime.prepareLevel(bisectExercise)
|
||||
listOf("git bisect start", "git bisect bad HEAD", "git bisect good known-good").forEach { command ->
|
||||
val (nextRepo, _) = bisectRuntime.execute(bisectExercise, bisectRepo, command)
|
||||
bisectRepo = nextRepo
|
||||
}
|
||||
val (bisectRunRepo, _) = bisectRuntime.execute(bisectExercise, bisectRepo, "git bisect run ./test-balance.sh")
|
||||
assertFalse(
|
||||
"Running bisect should not solve the bisect level until the learner enters the last good commit hash.",
|
||||
bisectExercise.validator(bisectRunRepo, "git bisect run ./test-balance.sh"),
|
||||
)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
Reference in New Issue
Block a user