aboutsummaryrefslogtreecommitdiff
path: root/test/segments
diff options
context:
space:
mode:
Diffstat (limited to 'test/segments')
-rwxr-xr-xtest/segments/dir.spec25
-rwxr-xr-xtest/segments/go_version.spec4
2 files changed, 28 insertions, 1 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'
diff --git a/test/segments/go_version.spec b/test/segments/go_version.spec
index 907dceb3..2aac460b 100755
--- a/test/segments/go_version.spec
+++ b/test/segments/go_version.spec
@@ -35,12 +35,14 @@ function mockGoEmptyGopath() {
function testGo() {
alias go=mockGo
+ POWERLEVEL9K_GO_ICON=""
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(go_version)
PWD="$HOME/go/src/github.com/bhilburn/powerlevel9k"
- assertEquals "%K{green} %F{255}go1.5.3 %k%F{green}%f " "$(build_left_prompt)"
+ assertEquals "%K{green} %F{255%}%f %F{255}go1.5.3 %k%F{green}%f " "$(build_left_prompt)"
+ unset POWERLEVEL9K_GO_ICON
unset PWD
unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
unalias go