Fix upstream fixture-backed level setups

This commit is contained in:
Joe Tretter
2026-05-19 15:52:22 -05:00
parent 2091713409
commit 5db02adbe9
13 changed files with 462 additions and 95 deletions

View File

@@ -13,7 +13,36 @@ internal fun findOldBranchLevel(): Level = level(
description = "You have been working on a branch but got distracted by a major issue. Switch back to that branch even though you forgot the name of it.",
hints = listOf("Ever played with the `git reflog` command?"),
commandSuggestions = listOf("git checkout solve_world_hunger"),
setup = { RepoState(initialized = true, branches = mapOf("master" to 1, "solve_world_hunger" to 2)) },
setup = {
RepoState(
initialized = true,
headBranch = "master",
files = listOf(
GitFile("myfile.txt", "THIS TEXT DOESN'T MATTER\n", tracked = true),
GitFile("TODO", "FIND THE JOKER\n", tracked = true),
),
branches = mapOf(
"blowup_sun_for_ransom" to 1,
"cure_common_cold" to 1,
"master" to 2,
"solve_world_hunger" to 2,
),
)
},
nativeSetup = {
resetFiles()
write("myfile.txt", "THIS TEXT DOESN'T MATTER\n")
addCommit("initial commit", "myfile.txt")
git("branch", "blowup_sun_for_ransom")
git("branch", "cure_common_cold")
checkoutNew("solve_world_hunger")
write("TODO", "FIX WORLD HUNGER\n")
addCommit("commit todo", "TODO")
checkout("master")
write("TODO", "FIND THE JOKER\n")
addCommit("commit another todo", "TODO")
true
},
validator = repoPredicate { repo -> repo.headBranch == "solve_world_hunger" },
testCases = listOf(
levelTestCase("checkout old branch", "git checkout solve_world_hunger"),