diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-07-25 08:52:06 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-07-25 08:52:06 +0300 |
commit | 06de83cc0f2282b2217c6151277dfd6789593c2e (patch) | |
tree | 8e7d013b2f66f9431b732f64fe8c8c5c8a87e7c5 /test/segments/status.spec | |
parent | 99f0eddd62806f99b8116e3f327689bc32529d5d (diff) |
Prepare tests for performance optimizations
Diffstat (limited to 'test/segments/status.spec')
-rwxr-xr-x | test/segments/status.spec | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/segments/status.spec b/test/segments/status.spec index d921111b..b3ba3e36 100755 --- a/test/segments/status.spec +++ b/test/segments/status.spec @@ -7,8 +7,6 @@ SHUNIT_PARENT=$0 function setUp() { export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme ### Test specific # Resets if someone has set these in his/hers env @@ -23,6 +21,9 @@ function testStatusPrintsNothingIfReturnCodeIsZeroAndVerboseIsUnset() { local POWERLEVEL9K_STATUS_VERBOSE=false local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" } @@ -33,6 +34,9 @@ function testStatusWorksAsExpectedIfReturnCodeIsZeroAndVerboseIsSet() { local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false local POWERLEVEL9K_STATUS_HIDE_SIGNAME=true + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{green%}✔%f %k%F{black}%f " "$(build_left_prompt)" } @@ -41,6 +45,9 @@ function testStatusInGeneralErrorCase() { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) local POWERLEVEL9K_STATUS_VERBOSE=true local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false + + # Load Powerlevel9k + source powerlevel9k.zsh-theme local RETVAL=1 assertEquals "%K{red} %F{yellow1%}↵ %f%F{yellow1}1 %k%F{red}%f " "$(build_left_prompt)" @@ -51,6 +58,9 @@ function testPipestatusInErrorCase() { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) local POWERLEVEL9K_STATUS_VERBOSE=true local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=true + + # Load Powerlevel9k + source powerlevel9k.zsh-theme local -a RETVALS RETVALS=(0 0 1 0) @@ -63,6 +73,9 @@ function testStatusCrossWinsOverVerbose() { local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false local POWERLEVEL9K_STATUS_VERBOSE=true local POWERLEVEL9K_STATUS_CROSS=true + + # Load Powerlevel9k + source powerlevel9k.zsh-theme local RETVAL=1 assertEquals "%K{black} %F{red%}✘%f %k%F{black}%f " "$(build_left_prompt)" @@ -74,6 +87,9 @@ function testStatusShowsSignalNameInErrorCase() { local POWERLEVEL9K_STATUS_SHOW_PIPESTATUS=false local POWERLEVEL9K_STATUS_VERBOSE=true local POWERLEVEL9K_STATUS_HIDE_SIGNAME=false + + # Load Powerlevel9k + source powerlevel9k.zsh-theme local RETVAL=132 assertEquals "%K{red} %F{yellow1%}↵ %f%F{yellow1}SIGILL(4) %k%F{red}%f " "$(build_left_prompt)" @@ -84,6 +100,10 @@ function testStatusSegmentIntegrated() { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status) local -a POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=() + local POWERLEVEL9K_STATUS_CROSS=true + + # Load Powerlevel9k + source powerlevel9k.zsh-theme false; powerlevel9k_prepare_prompts |