Misc Changes

This commit is contained in:
Joe Tretter
2026-05-06 21:28:44 -05:00
parent 5727022baf
commit e1b2d7f7a1
64 changed files with 1662 additions and 300 deletions

View File

@@ -0,0 +1,22 @@
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 ."),
),
)