Prepare tests for performance optimizations

This commit is contained in:
Dominik Ritter 2018-07-25 07:52:06 +02:00
commit 06de83cc0f
31 changed files with 645 additions and 117 deletions

View file

@ -7,8 +7,6 @@ SHUNIT_PARENT=$0
function setUp() {
export TERM="xterm-256color"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
}
function testCustomDirectOutputSegment() {
@ -16,6 +14,9 @@ function testCustomDirectOutputSegment() {
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
@ -26,6 +27,9 @@ function testCustomClosureSegment() {
echo "world"
}
local POWERLEVEL9K_CUSTOM_WORLD='p9k_hello_world'
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
@ -36,6 +40,9 @@ function testSettingBackgroundForCustomSegment() {
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_BACKGROUND="yellow"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{yellow} %F{black}world %k%F{yellow}%f " "$(build_left_prompt)"
}
@ -45,6 +52,9 @@ function testSettingForegroundForCustomSegment() {
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_FOREGROUND="red"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{white} %F{red}world %k%F{white}%f " "$(build_left_prompt)"
}
@ -54,6 +64,9 @@ function testSettingVisualIdentifierForCustomSegment() {
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{white} %F{black%}hw %f%F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
@ -64,6 +77,9 @@ function testSettingVisualIdentifierForegroundColorForCustomSegment() {
local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw"
local POWERLEVEL9K_CUSTOM_WORLD_VISUAL_IDENTIFIER_COLOR="red"
# Load Powerlevel9k
source powerlevel9k.zsh-theme
assertEquals "%K{white} %F{red%}hw %f%F{black}world %k%F{white}%f " "$(build_left_prompt)"
}