package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `tag` 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 tagLevel(): Level = level(
    id = "tag",
    title = "Tag",
    description = "We have a git repo and we want to tag the current commit with `new_tag`.",
    hints = listOf("Take a look at `git tag`."),
    commandSuggestions = listOf("git tag new_tag", "git tag"),
    setup = { RepoState(initialized = true, files = listOf(GitFile("somefile.txt", tracked = true)), commits = listOf(CommitNode("0000001", "Added some file to the repo")), branches = mapOf("master" to 1)) },
    validator = repoPredicate { repo -> "new_tag" in repo.tags },
    testCases = listOf(
        levelTestCase("create tag", "git tag new_tag"),
    ),
)
