From 6cfe8f8d965bfb6a1314b907e4ab970dd42d4188 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Mon, 12 Nov 2018 00:37:34 +0100 Subject: [PATCH] Add test for detecting untracked files from sibling folder --- test/segments/vcs-git.spec | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/segments/vcs-git.spec b/test/segments/vcs-git.spec index fed1df19..17a277fb 100755 --- a/test/segments/vcs-git.spec +++ b/test/segments/vcs-git.spec @@ -473,4 +473,21 @@ function testDetectingUntrackedFilesInNestedSubmodulesWork() { assertEquals "%K{002} %F{000} master ? %k%F{002}%f " "$(build_left_prompt)" } -source shunit2/shunit2 \ No newline at end of file +function testDetectingUntrackedFilesInCleanSubdirectoryWorks() { + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY="true" + unset POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND + mkdir clean-folder + touch clean-folder/file.txt + mkdir dirty-folder + touch dirty-folder/file.txt + git add . 2>/dev/null + git commit -m "Initial commit" >/dev/null + touch dirty-folder/new-file.txt + cd clean-folder + source ${P9K_HOME}/powerlevel9k.zsh-theme + assertEquals "%K{002} %F{000} master ? %k%F{002}%f " "$(build_left_prompt)" +} + +source shunit2/shunit2