summaryrefslogtreecommitdiff
path: root/test/segments/dir.spec
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-14 12:48:25 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-14 12:48:25 +0300
commitdba80dbee922fee79b8709ac7fa981867bed89c5 (patch)
tree8c21dc4988ef8c764333f76ee3d37337fa1b3639 /test/segments/dir.spec
parent1e54872873270b89700c3f88783bdc301ba40e50 (diff)
Added tests for other folder highlighing
Diffstat (limited to 'test/segments/dir.spec')
-rwxr-xr-xtest/segments/dir.spec82
1 files changed, 79 insertions, 3 deletions
diff --git a/test/segments/dir.spec b/test/segments/dir.spec
index 41f82eca..221ccea2 100755
--- a/test/segments/dir.spec
+++ b/test/segments/dir.spec
@@ -62,7 +62,7 @@ function testTruncationFromRightWorks() {
mkdir -p $FOLDER
cd $FOLDER
- assertEquals "%K{blue} %F{black}/tmp/po…/1/12/123/12…/12…/12…/12…/12…/123456789%b% %k%F{blue}%f " "$(build_left_prompt)"
+ assertEquals "%K{blue} %F{black}/tmp/po…/1/12/123/12…/12…/12…/12…/12…/123456789%b %k%F{blue}%f " "$(build_left_prompt)"
cd -
rm -fr /tmp/powerlevel9k-test
@@ -437,7 +437,29 @@ function testBoldHomeDirectoryWorks() {
unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD
}
-function testBoldOtherDirectoryWorks() {
+function testBoldHomeSubdirWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
+ mkdir -p ~/powerlevel9k-test
+ cd ~/powerlevel9k-test
+
+ assertEquals "%K{blue} %F{black}~/%Bpowerlevel9k-test%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ rm -fr ~/powerlevel9k-test
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD
+}
+
+function testBoldRootDirectoryWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
+ cd /
+
+ assertEquals "%K{blue} %F{black}%B/%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD
+}
+
+function testBoldRootSubdirWorks() {
POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
cd /tmp
@@ -447,7 +469,17 @@ function testBoldOtherDirectoryWorks() {
unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD
}
-function testDirHighlightHomeWorks() {
+function testBoldRootSubsubdirWorks() {
+ mkdir -p /tmp/powerlevel9k-test
+ cd /tmp/powerlevel9k-test
+
+ assertEquals "%K{blue} %F{black}/tmp/%Bpowerlevel9k-test%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ rm -fr /tmp/powerlevel9k-test
+}
+
+function testHighlightHomeWorks() {
POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'
cd ~
@@ -457,4 +489,48 @@ function testDirHighlightHomeWorks() {
unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND
}
+function testHighlightHomeSubdirWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'
+ mkdir -p ~/powerlevel9k-test
+ cd ~/powerlevel9k-test
+
+ assertEquals "%K{blue} %F{black}~/%F{red}powerlevel9k-test%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ rm -fr ~/powerlevel9k-test
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND
+}
+
+function testHighlightRootWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'
+ cd /
+
+ assertEquals "%K{blue} %F{black}%F{red}/%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND
+}
+
+function testHighlightRootSubdirDirectoryWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'
+ cd /tmp
+
+ assertEquals "%K{blue} %F{black}/%F{red}tmp%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND
+}
+
+function testHighlightRootSubdirDirectoryWorks() {
+ POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'
+ mkdir /tmp/powerlevel9k-test
+ cd /tmp/powerlevel9k-test
+
+ assertEquals "%K{blue} %F{black}/tmp/%F{red}powerlevel9k-test%b %k%F{blue}%f " "$(build_left_prompt)"
+
+ cd -
+ rm -fr /tmp/powerlevel9k-test
+ unset POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND
+}
+
source shunit2/source/2.1/src/shunit2