diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2019-02-03 21:35:11 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2019-02-03 21:52:29 +0300 |
commit | 06151eeba90ce7ce54b4222d3ef359b4edb10edf (patch) | |
tree | b0cb784f6cd33d6eab194bf8594bbd682bf6f926 /test/segments/newline.spec | |
parent | 40e04e053cae8b49b5b82c047660369f962d1975 (diff) | |
parent | 0b2990b88578bf758147180161c7909f267a930a (diff) |
Merge remote-tracking branch 'ben/master' into HEAD
Diffstat (limited to 'test/segments/newline.spec')
-rwxr-xr-x | test/segments/newline.spec | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/segments/newline.spec b/test/segments/newline.spec new file mode 100755 index 00000000..7cd00a89 --- /dev/null +++ b/test/segments/newline.spec @@ -0,0 +1,42 @@ +#!/usr/bin/env zsh +#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 + +# Required for shunit2 to run correctly +setopt shwordsplit +SHUNIT_PARENT=$0 + +function setUp() { + export TERM="xterm-256color" + + P9K_HOME=$(pwd) + ### Test specific +} + +function testNewlineDoesNotCreateExtraSegmentSeparator() { + local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" + local POWERLEVEL9K_CUSTOM_WORLD2="echo world2" + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 newline newline newline custom_world2) + + # Load Powerlevel9k + source ${P9K_HOME}/powerlevel9k.zsh-theme + local OS="OSX" # Fake OSX + + local newline=$'\n' + + assertEquals "%K{007} %F{000}world1 %k%F{007}%f${newline}%k%f${newline}%k%f${newline}%K{007} %F{000}world2 %k%F{007}%f " "$(build_left_prompt)" +} + +function testNewlineMakesPreviousSegmentEndWell() { + local POWERLEVEL9K_CUSTOM_WORLD1="echo world1" + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1 newline) + + # Load Powerlevel9k + source ${P9K_HOME}/powerlevel9k.zsh-theme + local OS="OSX" # Fake OSX + + local newline=$'\n' + + assertEquals "%K{007} %F{000}world1 %k%F{007}%f${newline}%k%F{none}%f " "$(build_left_prompt)" +} + +source shunit2/shunit2
\ No newline at end of file |