aboutsummaryrefslogtreecommitdiff
path: root/test/powerlevel9k.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2016-02-13 19:25:03 +0300
committerDominik Ritter <dritter03@googlemail.com>2016-02-13 19:25:03 +0300
commita75b0c17d25cbada32458a71a2d8ada07a35f026 (patch)
treee17fbdb30d5796edb4df3ba456975424e58505a8 /test/powerlevel9k.spec
parent8a386ba1b39e574b00e002dbb4e9e0f0c8c3f59e (diff)
Add tests for visual identifiers
Diffstat (limited to 'test/powerlevel9k.spec')
-rwxr-xr-xtest/powerlevel9k.spec36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/powerlevel9k.spec b/test/powerlevel9k.spec
index 3ed33d64..7a85e516 100755
--- a/test/powerlevel9k.spec
+++ b/test/powerlevel9k.spec
@@ -45,4 +45,40 @@ function testDynamicColoringOfSegmentsWork() {
unset POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND
}
+function testDynamicColoringOfVisualIdentifiersWork() {
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir)
+ POWERLEVEL9K_MODE='awesome-patched'
+ POWERLEVEL9K_DIR_HOME_SUBFOLDER_VISUAL_IDENTIFIER_COLOR='green'
+
+ # Re-Source the icons, as the POWERLEVEL9K_MODE is directly
+ # evaluated there.
+ source functions/icons.zsh
+
+ assertEquals "%K{blue} %F{green%}%f %F{black}%~ %k%F{blue}%f " "$(build_left_prompt)"
+
+ unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ unset POWERLEVEL9K_MODE
+ unset POWERLEVEL9K_DIR_HOME_SUBFOLDER_VISUAL_IDENTIFIER_COLOR
+}
+
+function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() {
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir)
+ POWERLEVEL9K_MODE='awesome-patched'
+ POWERLEVEL9K_DIR_HOME_SUBFOLDER_VISUAL_IDENTIFIER_COLOR='green'
+ POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='red'
+ POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='yellow'
+
+ # Re-Source the icons, as the POWERLEVEL9K_MODE is directly
+ # evaluated there.
+ source functions/icons.zsh
+
+ assertEquals "%K{yellow} %F{green%}%f %F{red}%~ %k%F{yellow}%f " "$(build_left_prompt)"
+
+ unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ unset POWERLEVEL9K_MODE
+ unset POWERLEVEL9K_DIR_HOME_SUBFOLDER_VISUAL_IDENTIFIER_COLOR
+ unset POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND
+ unset POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND
+}
+
source shunit2/source/2.1/src/shunit2