1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 18:20:07 +00:00

Merge branch 'dritter-fix_dir_home_issue' into fix_dir_nav

This commit is contained in:
Conrad Haupt 2018-03-21 10:26:15 +02:00
commit d43f128c86

View file

@ -36,6 +36,27 @@ function testTruncateFoldersWorks() {
unset POWERLEVEL9K_SHORTEN_STRATEGY 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() { function testTruncateMiddleWorks() {
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_SHORTEN_STRATEGY='truncate_middle' POWERLEVEL9K_SHORTEN_STRATEGY='truncate_middle'