summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2018-04-14 04:55:30 +0300
committerGitHub <noreply@github.com>2018-04-14 04:55:30 +0300
commit0d8bfb68f44769add9d035eb07acc191485e197c (patch)
tree6c252c3456f9a2397276c750d3bdcfbfa430ad4c /test
parent83e32671020e5db5d93d925271175b636f88fbab (diff)
parentd43f128c8673efd5f8c5b7c94525c16c25621d31 (diff)
Merge pull request #773 from conradhaupt/fix_dir_nav
Fixed home abbreviation not being exclusive with circular navigation
Diffstat (limited to 'test')
-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'