diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2019-02-02 01:48:39 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2019-02-02 01:48:39 +0300 |
commit | 8bb86908d74097cda237115273acfdbaa5f39ea1 (patch) | |
tree | 26f59bb33c84ad4614dbfc68f8973383c6cb3978 /test/segments/dir.spec | |
parent | 8f603093862d519caad072e102d22c515e8847b5 (diff) |
Add tests
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-x | test/segments/dir.spec | 18 |
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 |