summaryrefslogtreecommitdiff
path: root/test/powerlevel9k.spec
diff options
context:
space:
mode:
Diffstat (limited to 'test/powerlevel9k.spec')
-rwxr-xr-xtest/powerlevel9k.spec25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/powerlevel9k.spec b/test/powerlevel9k.spec
index 5f6b6f27..0ddf36c1 100755
--- a/test/powerlevel9k.spec
+++ b/test/powerlevel9k.spec
@@ -65,7 +65,7 @@ function testDynamicColoringOfVisualIdentifiersWork() {
cd /tmp
- assertEquals "%K{blue} %F{green%}icon-here%f %F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
+ assertEquals "%K{blue} %F{green%}icon-here %f%F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
unset POWERLEVEL9K_DIR_DEFAULT_VISUAL_IDENTIFIER_COLOR
@@ -86,7 +86,7 @@ function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() {
cd /tmp
- assertEquals "%K{yellow} %F{green%}icon-here%f %F{red}/tmp %k%F{yellow}%f " "$(build_left_prompt)"
+ assertEquals "%K{yellow} %F{green%}icon-here %f%F{red}/tmp %k%F{yellow}%f " "$(build_left_prompt)"
unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
unset POWERLEVEL9K_DIR_DEFAULT_VISUAL_IDENTIFIER_COLOR
@@ -106,7 +106,7 @@ function testOverwritingIconsWork() {
#cd ~/$testFolder
cd /tmp
- assertEquals "%K{blue} %F{black%}icon-here%f %F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
+ assertEquals "%K{blue} %F{black%}icon-here %f%F{black}/tmp %k%F{blue}%f " "$(build_left_prompt)"
unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
unset POWERLEVEL9K_DIR_FOLDER_ICON
@@ -114,4 +114,23 @@ function testOverwritingIconsWork() {
# rm -fr ~/$testFolder
}
+function testNewlineOnRpromptCanBeDisabled() {
+ POWERLEVEL9K_PROMPT_ON_NEWLINE=true
+ POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
+ POWERLEVEL9K_CUSTOM_WORLD='echo world'
+ POWERLEVEL9K_CUSTOM_RWORLD='echo rworld'
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(custom_rworld)
+
+ powerlevel9k_prepare_prompts
+ assertEquals '$(print_icon MULTILINE_FIRST_PROMPT_PREFIX) world  $(print_icon MULTILINE_LAST_PROMPT_PREFIX) rworld' "$(print -P ${PROMPT}${RPROMPT})"
+
+ unset POWERLEVEL9K_PROMPT_ON_NEWLINE
+ unset POWERLEVEL9K_RPROMPT_ON_NEWLINE
+ unset POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ unset POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS
+ unset POWERLEVEL9K_CUSTOM_WORLD
+ unset POWERLEVEL9K_CUSTOM_RWORLD
+}
+
source shunit2/source/2.1/src/shunit2