diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-08-12 20:52:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-12 20:52:10 +0300 |
commit | 9f4faf7f21a992f32114f134dfb0737657241b37 (patch) | |
tree | 1e8de4a7dcb38e93c4d02ebd16aff4c4eea4d5da /test | |
parent | 02332d596214c8e68bd3e86a8d0b90d3a4d60cf1 (diff) | |
parent | e464b4e2a559508f9f4e0a9bc28a3b1e7d08fbd6 (diff) |
Merge pull request #596 from eumiro/truncate_to_unique
Add TRUNCATE_TO_UNIQUE shortening dir strategy
Diffstat (limited to 'test')
-rwxr-xr-x | test/segments/dir.spec | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec index bb0297e2..ef27e160 100755 --- a/test/segments/dir.spec +++ b/test/segments/dir.spec @@ -406,4 +406,25 @@ function testOmittingFirstCharacterWorksWithChangingPathSeparatorAndRightTruncat unset POWERLEVEL9K_SHORTEN_STRATEGY } +function testTruncateToUniqueWorks() { + POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true + POWERLEVEL9K_DIR_PATH_SEPARATOR='xXx' + POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 + POWERLEVEL9K_SHORTEN_STRATEGY='truncate_to_unique' + mkdir -p /tmp/powerlevel9k-test/adam/devl + mkdir -p /tmp/powerlevel9k-test/alice/devl + mkdir -p /tmp/powerlevel9k-test/alice/docs + mkdir -p /tmp/powerlevel9k-test/bob/docs + cd /tmp/powerlevel9k-test/alice/devl + + assertEquals "%K{blue} %F{black}txXxpxXxalxXxde %k%F{blue}%f " "$(build_left_prompt)" + + cd - + rm -fr /tmp/powerlevel9k-test + unset POWERLEVEL9K_DIR_PATH_SEPARATOR + unset POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER + unset POWERLEVEL9K_SHORTEN_DIR_LENGTH + unset POWERLEVEL9K_SHORTEN_STRATEGY +} + source shunit2/source/2.1/src/shunit2 |