summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Haupt <conradjhaupt@gmail.com>2018-03-21 11:26:15 +0300
committerConrad Haupt <conradjhaupt@gmail.com>2018-03-21 11:26:15 +0300
commitd43f128c8673efd5f8c5b7c94525c16c25621d31 (patch)
tree86c85f73ee5050930ee57321b815385cf2bdec6b
parenta761e3c28a78cfbf7d7ca9cde5bdcd1126c2996c (diff)
parent83ad5b598e1524fa76055f8ed086eb155c39c580 (diff)
Merge branch 'dritter-fix_dir_home_issue' into fix_dir_nav
-rwxr-xr-xtest/segments/dir.spec21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec
index ef27e160..97bc857c 100755
--- a/test/segments/dir.spec
+++ b/test/segments/dir.spec
@@ -36,6 +36,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'