package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `add` 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 addLevel(): Level = level(
    id = "add",
    title = "Add",
    description = "There is a file in your folder called `README`; add it to your staging area.\nNote: Each level starts with a new repo. Don't look for files of the previous one.",
    hints = listOf("You can type `git` in your shell to get a list of available git commands."),
    commandSuggestions = listOf("git add README", "git status"),
    setup = { RepoState(initialized = true, files = listOf(GitFile("README")), branches = mapOf("master" to 0)) },
    validator = repoPredicate { repo -> repo.files.any { it.name == "README" && it.staged } },
    testCases = listOf(
        levelTestCase("add exact file", "git add README"),
        levelTestCase("add all", "git add ."),
    ),
)
