Misc Changes
This commit is contained in:
@@ -55,6 +55,28 @@ class GitSandboxEngineTest {
|
||||
assertTrue(updatedRepo.files.any { it.name == "README" })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun singleQuotedWildcardIsNotExpanded() {
|
||||
val repo = RepoState(
|
||||
initialized = true,
|
||||
files = listOf(GitFile("README"), GitFile("main.kt")),
|
||||
)
|
||||
|
||||
val (_, output) = GitSandboxEngine.execute(repo, "echo '*'")
|
||||
|
||||
assertEquals(listOf("*"), output)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun echoRedirectAcceptsNoSurroundingSpaces() {
|
||||
val repo = RepoState(initialized = true)
|
||||
|
||||
val (updatedRepo, output) = GitSandboxEngine.execute(repo, "echo '*.swp'>.gitignore")
|
||||
|
||||
assertTrue(output.isEmpty())
|
||||
assertEquals("*.swp", updatedRepo.files.single { it.name == ".gitignore" }.content)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun commitHashAnswerAcceptsFullHashThatStartsWithDisplayedShortHash() {
|
||||
val repo = RepoState(
|
||||
@@ -88,6 +110,18 @@ class GitSandboxEngineTest {
|
||||
assertTrue("src/main.kt" in output)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun lsShowsDotfiles() {
|
||||
val repo = RepoState(
|
||||
initialized = true,
|
||||
files = listOf(GitFile(".gitignore"), GitFile("README")),
|
||||
)
|
||||
|
||||
val (_, output) = GitSandboxEngine.execute(repo, "ls")
|
||||
|
||||
assertTrue(".gitignore" in output)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cdDotDotShortcutMovesToParentDirectory() {
|
||||
val repo = RepoState(initialized = true, currentDir = "src/main")
|
||||
|
||||
Reference in New Issue
Block a user