summaryrefslogtreecommitdiff
path: root/test/segments
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2019-02-02 02:48:54 +0300
committerGitHub <noreply@github.com>2019-02-02 02:48:54 +0300
commit22f6495005dc999244e931d3dab44d7ca063a272 (patch)
treef0e70e201a41453eb916eb3cfcbb3d445b4b9c6a /test/segments
parent08798d12ad0b7e32423c0eb8623189db180fd094 (diff)
parent8bb86908d74097cda237115273acfdbaa5f39ea1 (diff)
Merge pull request #1151 from Wuestengecko/bugfix-1150
[Bugfix] Only abbreviate $HOME at the beginning of cwd
Diffstat (limited to 'test/segments')
-rwxr-xr-xtest/segments/dir.spec18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec
index 46e0cfb8..d75ca42f 100755
--- a/test/segments/dir.spec
+++ b/test/segments/dir.spec
@@ -768,4 +768,22 @@ function testDirSeparatorColorRootSubSubdirWorks() {
rm -fr /tmp/powerlevel9k-test
}
+function testDirHomeTruncationWorksOnlyAtTheBeginning() {
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir)
+
+ local FOLDER=/tmp/p9ktest
+ local SAVED_HOME="${HOME}"
+ HOME="/p9ktest"
+
+ mkdir -p $FOLDER
+ # Setup folder marker
+ cd $FOLDER
+ assertEquals "%K{004} %F{000}/tmp/p9ktest %k%F{004}%f " "$(build_left_prompt)"
+
+ cd -
+ rm -fr $FOLDER
+ HOME="${SAVED_HOME}"
+}
+
source shunit2/shunit2