diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-06-07 00:15:51 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-06-07 00:40:37 +0300 |
commit | 55473c450a598c230ea388e169c62efe72add63b (patch) | |
tree | 09057d2f7d5743afcdcce1947305beba4ebe6617 /test/segments/dir.spec | |
parent | 7234d52ebd76b6b89e172ac5b19339f0a37ab596 (diff) | |
parent | 13b0e383a066c9c37d5cf71d4af521f9b73a173e (diff) |
Merge branch 'master' into staging_065
Conflicts were:
- README.md: Two commits targeted the brightness table. #781 from
14. April 2018 on master and #684 from 05. December 2017 on next.
- powerlevel9k.zsh-theme: Two commits targeted the rbenv segment. Both
achieve the same thing: To show the Ruby version number always. #795 on
next from 14. April 2018 and #610 on master from 28. September 2017. I
went with #795 here as this - although being newer - is the one on
master, and that should be more stable.
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-x | test/segments/dir.spec | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec index 66009a86..e8bbaf93 100755 --- a/test/segments/dir.spec +++ b/test/segments/dir.spec @@ -46,6 +46,27 @@ function testTruncateFoldersWorks() { unset POWERLEVEL9K_SHORTEN_STRATEGY } +function testTruncateFolderWithHomeDirWorks() { + POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + CURRENT_DIR=$(pwd) + + cd ~ + FOLDER="powerlevel9k-test-${RANDOM}" + mkdir -p $FOLDER + cd $FOLDER + # Switch back to home folder as this causes the problem. + cd .. + + assertEquals "%K{blue} %F{black}~ %k%F{blue}%f " "$(build_left_prompt)" + + rmdir $FOLDER + cd ${CURRENT_DIR} + + unset CURRENT_DIR + unset FOLDER + unset POWERLEVEL9K_SHORTEN_DIR_LENGTH +} + function testTruncateMiddleWorks() { POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_SHORTEN_STRATEGY='truncate_middle' |