diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2019-02-03 21:35:11 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2019-02-03 21:52:29 +0300 |
commit | 06151eeba90ce7ce54b4222d3ef359b4edb10edf (patch) | |
tree | b0cb784f6cd33d6eab194bf8594bbd682bf6f926 /test/segments/dir.spec | |
parent | 40e04e053cae8b49b5b82c047660369f962d1975 (diff) | |
parent | 0b2990b88578bf758147180161c7909f267a930a (diff) |
Merge remote-tracking branch 'ben/master' into HEAD
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-x | test/segments/dir.spec | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec index 7e65cb71..d75ca42f 100755 --- a/test/segments/dir.spec +++ b/test/segments/dir.spec @@ -352,7 +352,7 @@ function testHomeFolderDetectionWorks() { source ${P9K_HOME}/powerlevel9k.zsh-theme cd ~ - assertEquals "%K{004} %F{000}home-icon %f%F{000}~ %k%F{004}%f " "$(build_left_prompt)" + assertEquals "%K{004} %F{000}home-icon %F{000}~ %k%F{004}%f " "$(build_left_prompt)" cd - } @@ -368,7 +368,7 @@ function testHomeSubfolderDetectionWorks() { local FOLDER=~/powerlevel9k-test mkdir $FOLDER cd $FOLDER - assertEquals "%K{004} %F{000}sub-icon %f%F{000}~/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" + assertEquals "%K{004} %F{000}sub-icon %F{000}~/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" cd - rm -fr $FOLDER @@ -385,7 +385,7 @@ function testOtherFolderDetectionWorks() { local FOLDER=/tmp/powerlevel9k-test mkdir $FOLDER cd $FOLDER - assertEquals "%K{004} %F{000}folder-icon %f%F{000}/tmp/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" + assertEquals "%K{004} %F{000}folder-icon %F{000}/tmp/powerlevel9k-test %k%F{004}%f " "$(build_left_prompt)" cd - rm -fr $FOLDER @@ -462,7 +462,7 @@ function testOmittingFirstCharacterWorks() { cd /tmp - assertEquals "%K{004} %F{000}folder-icon %f%F{000}tmp %k%F{004}%f " "$(build_left_prompt)" + assertEquals "%K{004} %F{000}folder-icon %F{000}tmp %k%F{004}%f " "$(build_left_prompt)" cd - } @@ -480,7 +480,7 @@ function testOmittingFirstCharacterWorksWithChangingPathSeparator() { mkdir -p /tmp/powerlevel9k-test/1/2 cd /tmp/powerlevel9k-test/1/2 - assertEquals "%K{004} %F{000}folder-icon %f%F{000}tmpxXxpowerlevel9k-testxXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" + assertEquals "%K{004} %F{000}folder-icon %F{000}tmpxXxpowerlevel9k-testxXx1xXx2 %k%F{004}%f " "$(build_left_prompt)" cd - rm -fr /tmp/powerlevel9k-test @@ -768,4 +768,22 @@ function testDirSeparatorColorRootSubSubdirWorks() { rm -fr /tmp/powerlevel9k-test } +function testDirHomeTruncationWorksOnlyAtTheBeginning() { + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir) + + local FOLDER=/tmp/p9ktest + local SAVED_HOME="${HOME}" + HOME="/p9ktest" + + mkdir -p $FOLDER + # Setup folder marker + cd $FOLDER + assertEquals "%K{004} %F{000}/tmp/p9ktest %k%F{004}%f " "$(build_left_prompt)" + + cd - + rm -fr $FOLDER + HOME="${SAVED_HOME}" +} + source shunit2/shunit2 |