package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `bisect` level.
 *
 * Setup documents the repository shape the learner explores. Evaluation is kept
 * state-based whenever the exercise changes repository objects; answer-only
 * levels intentionally validate the answer entered at the prompt.
 */
internal fun bisectLevel(): Level = level(
    id = "bisect",
    title = "Bisect",
    description = "A bug was introduced somewhere along the way. You know that running `ruby prog.rb 5` should output 15. You can also run `make test`. What are the first 7 chars of the hash of the commit (the abbreviated hash) that introduced the bug?",
    hints = emptyList(),
    commandSuggestions = listOf("git bisect start", "make test"),
    setup = { RepoState(initialized = true, branches = mapOf("master" to 7), commits = listOf(CommitNode("18ed2ac", "Introduce bug"))) },
    validator = commitHashAnswer("18ed2ac"),
    testCases = listOf(
        levelTestCase("answer bad commit", "18ed2ac"),
    ),
)
