summaryrefslogtreecommitdiff
path: root/test/segments/dir.spec
diff options
context:
space:
mode:
authorChristian Höltje <docwhat@gerf.org>2017-07-12 07:48:35 +0300
committerChristian Höltje <docwhat@gerf.org>2017-07-12 07:54:30 +0300
commit0fded47ab587a28e4656b95dff39340d204f28d4 (patch)
treee656cc018ff7355ee4a457e46380033d08a25d5a /test/segments/dir.spec
parent92ff579d5b7e8d16924050899695f98af02673f7 (diff)
Added test for POWERLEVEL9K_HOME_FOLDER_ABBREVIATION
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-xtest/segments/dir.spec25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec
index b2991175..f4842f38 100755
--- a/test/segments/dir.spec
+++ b/test/segments/dir.spec
@@ -272,6 +272,31 @@ function testChangingDirPathSeparator() {
unset POWERLEVEL9K_DIR_PATH_SEPARATOR
}
+function testHomeFolderAbbreviation() {
+ local POWERLEVEL9K_HOME_FOLDER_ABBREVIATION
+ local dir=$PWD
+
+ cd ~/
+ # default
+ POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='~'
+ assertEquals "%K{blue} %F{black}~ %k%F{blue}%f " "$(build_left_prompt)"
+
+ # substituted
+ POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='qQq'
+ assertEquals "%K{blue} %F{black}qQq %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd /tmp
+ # default
+ POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='~'
+ assertEquals "%K{blue} %F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
+
+ # substituted
+ POWERLEVEL9K_HOME_FOLDER_ABBREVIATION='qQq'
+ assertEquals "%K{blue} %F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd "$dir"
+}
+
function testOmittingFirstCharacterWorks() {
POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
POWERLEVEL9K_FOLDER_ICON='folder-icon'