mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-11 22:02:32 +01:00
Prepare tests for performance optimizations
This commit is contained in:
parent
99f0eddd62
commit
06de83cc0f
31 changed files with 645 additions and 117 deletions
|
|
@ -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)"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue