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/context.spec | |
parent | 99f0eddd62806f99b8116e3f327689bc32529d5d (diff) |
Prepare tests for performance optimizations
Diffstat (limited to 'test/segments/context.spec')
-rwxr-xr-x | test/segments/context.spec | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/segments/context.spec b/test/segments/context.spec index 702280df..b350caf7 100755 --- a/test/segments/context.spec +++ b/test/segments/context.spec @@ -7,8 +7,6 @@ SHUNIT_PARENT=$0 function setUp() { export TERM="xterm-256color" - # Load Powerlevel9k - source powerlevel9k.zsh-theme # Test specific settings OLD_DEFAULT_USER=$DEFAULT_USER @@ -26,6 +24,9 @@ function testContextSegmentDoesNotGetRenderedWithDefaultUser() { local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context custom_world) + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" } @@ -34,6 +35,9 @@ function testContextSegmentDoesGetRenderedWhenSshConnectionIsOpen() { local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } @@ -41,14 +45,20 @@ function testContextSegmentWithForeignUser() { local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } # TODO: How to test root? function testContextSegmentWithRootUser() { + startSkipping # Skip test local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) - startSkipping # Skip test + + # Load Powerlevel9k + source powerlevel9k.zsh-theme assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } @@ -58,6 +68,9 @@ function testOverridingContextTemplate() { POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context) local POWERLEVEL9K_CONTEXT_TEMPLATE=xx + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{yellow}xx %k%F{black}%f " "$(build_left_prompt)" } @@ -67,6 +80,9 @@ function testContextSegmentIsShownIfDefaultUserIsSetWhenForced() { local POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true local DEFAULT_USER=$(whoami) + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{yellow}%n@%m %k%F{black}%f " "$(build_left_prompt)" } @@ -76,6 +92,9 @@ function testContextSegmentIsShownIfForced() { local POWERLEVEL9K_ALWAYS_SHOW_USER=true local DEFAULT_USER=$(whoami) + # Load Powerlevel9k + source powerlevel9k.zsh-theme + assertEquals "%K{black} %F{yellow}$(whoami) %k%F{black}%f " "$(build_left_prompt)" } |