Auto-commit after successful build: update app gameplay/UI, improve build setup

Changed files:\napp/build.gradle.kts
app/src/main/java/solutions/tretter/githugandroid/GitEditorCommands.kt
app/src/main/java/solutions/tretter/githugandroid/GitHugApp.kt
app/src/main/java/solutions/tretter/githugandroid/GitMessageEditorDialog.kt
app/src/main/java/solutions/tretter/githugandroid/GitRuntime.kt
app/src/test/java/solutions/tretter/githugandroid/GitEditorCommandsTest.kt
This commit is contained in:
Joe Tretter
2026-05-02 23:03:00 -05:00
parent 01d10f31c2
commit 4963123b3b
6 changed files with 313 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
package solutions.tretter.githugandroid
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class GitEditorCommandsTest {
@Test
fun commitWithoutMessageOpensEditor() {
val invocation = parseGitEditorInvocation("git commit")
assertEquals(GitEditorCommandKind.COMMIT_MESSAGE, invocation?.kind)
assertEquals("Edit Commit Message", invocation?.title)
}
@Test
fun commitWithMessageDoesNotOpenEditor() {
assertNull(parseGitEditorInvocation("git commit -m \"message\""))
}
@Test
fun amendNoEditDoesNotOpenEditor() {
assertNull(parseGitEditorInvocation("git commit --amend --no-edit"))
}
@Test
fun annotatedTagWithoutMessageOpensEditor() {
val invocation = parseGitEditorInvocation("git tag -a v1.0")
assertEquals(GitEditorCommandKind.TAG_MESSAGE, invocation?.kind)
assertEquals("Edit Tag Message", invocation?.title)
}
@Test
fun lightweightTagDoesNotOpenEditor() {
assertNull(parseGitEditorInvocation("git tag v1.0"))
}
}