Ask for last good commit in bisect level

This commit is contained in:
Joe Tretter
2026-05-18 20:19:34 -05:00
parent 008a322134
commit 1ce4df1209
7 changed files with 62 additions and 24 deletions

View File

@@ -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 {