diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-08-09 01:28:50 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-08-09 01:28:50 +0300 |
commit | e0630d75736aa274f09545f9849c035c0c6cab9b (patch) | |
tree | 764814982754ee87313998d5037db96f0a3bae4a /test/core | |
parent | c7e543ff2382036b7ddc97af700164aa401f069f (diff) | |
parent | ef5f9bb1b494bcb1ceb81f7c833750d85701ca4a (diff) |
Merge branch 'fix_colors' into prepare_066
Diffstat (limited to 'test/core')
-rwxr-xr-x | test/core/color_overriding.spec | 10 | ||||
-rwxr-xr-x | test/core/visual_identifier.spec | 16 |
2 files changed, 18 insertions, 8 deletions
diff --git a/test/core/color_overriding.spec b/test/core/color_overriding.spec index 6b7c3d35..d3ed56ba 100755 --- a/test/core/color_overriding.spec +++ b/test/core/color_overriding.spec @@ -16,7 +16,7 @@ function testDynamicColoringOfSegmentsWork() { local POWERLEVEL9K_DATE_ICON="date-icon" local POWERLEVEL9K_DATE_BACKGROUND='red' - assertEquals "%K{009} %F{000%}date-icon %f%F{000}%D{%d.%m.%y} %k%F{009}%f " "$(build_left_prompt)" + assertEquals "%K{009} %F{000}date-icon %f%F{000}%D{%d.%m.%y} %k%F{009}%f " "$(build_left_prompt)" } function testDynamicColoringOfVisualIdentifiersWork() { @@ -24,7 +24,7 @@ function testDynamicColoringOfVisualIdentifiersWork() { local POWERLEVEL9K_DATE_ICON="date-icon" local POWERLEVEL9K_DATE_VISUAL_IDENTIFIER_COLOR='green' - assertEquals "%K{015} %F{green%}date-icon %f%F{000}%D{%d.%m.%y} %k%F{015}%f " "$(build_left_prompt)" + assertEquals "%K{015} %F{002}date-icon %f%F{000}%D{%d.%m.%y} %k%F{015}%f " "$(build_left_prompt)" } function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() { @@ -34,7 +34,7 @@ function testColoringOfVisualIdentifiersDoesNotOverwriteColoringOfSegment() { local POWERLEVEL9K_DATE_FOREGROUND='red' local POWERLEVEL9K_DATE_BACKGROUND='yellow' - assertEquals "%K{011} %F{green%}date-icon %f%F{009}%D{%d.%m.%y} %k%F{011}%f " "$(build_left_prompt)" + assertEquals "%K{011} %F{002}date-icon %f%F{009}%D{%d.%m.%y} %k%F{011}%f " "$(build_left_prompt)" } function testColorOverridingOfStatefulSegment() { @@ -45,7 +45,7 @@ function testColorOverridingOfStatefulSegment() { # Provoke state local SSH_CLIENT="x" - assertEquals "%K{009} %F{002%}ssh-icon %f%F{002}%m %k%F{009}%f " "$(build_left_prompt)" + assertEquals "%K{009} %F{002}ssh-icon %f%F{002}%m %k%F{009}%f " "$(build_left_prompt)" } function testColorOverridingOfCustomSegment() { @@ -56,7 +56,7 @@ function testColorOverridingOfCustomSegment() { local POWERLEVEL9K_CUSTOM_WORLD_FOREGROUND='red' local POWERLEVEL9K_CUSTOM_WORLD_BACKGROUND='red' - assertEquals "%K{009} %F{green%}CW %f%F{009}world %k%F{009}%f " "$(build_left_prompt)" + assertEquals "%K{009} %F{002}CW %f%F{009}world %k%F{009}%f " "$(build_left_prompt)" } source shunit2/shunit2
\ No newline at end of file diff --git a/test/core/visual_identifier.spec b/test/core/visual_identifier.spec index 8c8e3177..c31f8dac 100755 --- a/test/core/visual_identifier.spec +++ b/test/core/visual_identifier.spec @@ -18,7 +18,7 @@ function testOverwritingIconsWork() { local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - assertEquals "%K{015} %F{000%}icon-here %f%F{000}world1 %k%F{015}%f " "$(build_left_prompt)" + assertEquals "%K{015} %F{000}icon-here %f%F{000}world1 %k%F{015}%f " "$(build_left_prompt)" } function testVisualIdentifierAppearsBeforeSegmentContentOnLeftSegments() { @@ -27,7 +27,7 @@ function testVisualIdentifierAppearsBeforeSegmentContentOnLeftSegments() { local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - assertEquals "%K{015} %F{000%}icon-here %f%F{000}world1 %k%F{015}%f " "$(build_left_prompt)" + assertEquals "%K{015} %F{000}icon-here %f%F{000}world1 %k%F{015}%f " "$(build_left_prompt)" } function testVisualIdentifierAppearsAfterSegmentContentOnRightSegments() { @@ -36,7 +36,7 @@ function testVisualIdentifierAppearsAfterSegmentContentOnRightSegments() { local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here' - assertEquals "%F{015}%f%K{015}%F{000} world1%F{000%} icon-here%f%E" "$(build_right_prompt)" + assertEquals "%F{015}%f%K{015}%F{000} world1%F{000} icon-here%f%E" "$(build_right_prompt)" } function testVisualIdentifierPrintsNothingIfNotAvailable() { @@ -47,4 +47,14 @@ function testVisualIdentifierPrintsNothingIfNotAvailable() { assertEquals "%K{015} %F{000}world1 %k%F{015}%f " "$(build_left_prompt)" } +function testVisualIdentifierIsPrintedInNumericalColorCode() { + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1) + local POWERLEVEL9K_CUSTOM_WORLD1='echo world1' + local POWERLEVEL9K_CUSTOM_WORLD1_ICON="xxx" + local POWERLEVEL9K_CUSTOM_WORLD1_VISUAL_IDENTIFIER_COLOR="purple3" + + assertEquals "%K{015} %F{056}xxx %f%F{000}world1 %k%F{015}%f " "$(build_left_prompt)" +} + source shunit2/shunit2
\ No newline at end of file |