Merge branch 'fix_colors' into prepare_066
This commit is contained in:
commit
c7e543ff23
39 changed files with 589 additions and 601 deletions
|
@ -16,7 +16,7 @@ function testDynamicColoringOfSegmentsWork() {
|
|||
local POWERLEVEL9K_DATE_ICON="date-icon"
|
||||
local POWERLEVEL9K_DATE_BACKGROUND='red'
|
||||
|
||||
assertEquals "%K{red} %F{black%}date-icon %f%F{black}%D{%d.%m.%y} %k%F{red}%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{white} %F{green%}date-icon %f%F{black}%D{%d.%m.%y} %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{green%}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{yellow} %F{green%}date-icon %f%F{red}%D{%d.%m.%y} %k%F{yellow}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{011} %F{green%}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{red} %F{green%}ssh-icon %f%F{green}%m %k%F{red}%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{red} %F{green%}CW %f%F{red}world %k%F{red}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{009} %F{green%}CW %f%F{009}world %k%F{009}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
source shunit2/shunit2
|
|
@ -21,7 +21,7 @@ function testLeftNormalSegmentsShouldNotBeJoined() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD6="echo world6"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black} %F{black}world2 %K{white}%F{black} %F{black}world4 %K{white}%F{black} %F{black}world6 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000} %F{000}world2 %K{015}%F{000} %F{000}world4 %K{015}%F{000} %F{000}world6 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftJoinedSegments() {
|
||||
|
@ -30,7 +30,7 @@ function testLeftJoinedSegments() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD1="echo world1"
|
||||
local POWERLEVEL9K_CUSTOM_WORLD2="echo world2"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black}%F{black}world2 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000}%F{000}world2 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftTransitiveJoinedSegments() {
|
||||
|
@ -40,7 +40,7 @@ function testLeftTransitiveJoinedSegments() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD2="echo world2"
|
||||
local POWERLEVEL9K_CUSTOM_WORLD3="echo world3"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black}%F{black}world2 %K{white}%F{black}%F{black}world3 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000}%F{000}world2 %K{015}%F{000}%F{000}world3 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftTransitiveJoiningWithConditionalJoinedSegment() {
|
||||
|
@ -51,7 +51,7 @@ function testLeftTransitiveJoiningWithConditionalJoinedSegment() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD4="echo world4"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black}%F{black}world2 %K{white}%F{black}%F{black}world4 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000}%F{000}world2 %K{015}%F{000}%F{000}world4 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftPromotingSegmentWithConditionalPredecessor() {
|
||||
|
@ -61,7 +61,7 @@ function testLeftPromotingSegmentWithConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD3="echo world3"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black} %F{black}world3 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000} %F{000}world3 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftPromotingSegmentWithJoinedConditionalPredecessor() {
|
||||
|
@ -72,7 +72,7 @@ function testLeftPromotingSegmentWithJoinedConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD4="echo world4"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black} %F{black}world4 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000} %F{000}world4 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftPromotingSegmentWithDeepJoinedConditionalPredecessor() {
|
||||
|
@ -85,7 +85,7 @@ function testLeftPromotingSegmentWithDeepJoinedConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD6="echo world6"
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %K{white}%F{black} %F{black}world4 %K{white}%F{black}%F{black}world6 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %K{015}%F{000} %F{000}world4 %K{015}%F{000}%F{000}world6 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
function testLeftJoiningBuiltinSegmentWorks() {
|
||||
|
@ -93,7 +93,7 @@ function testLeftJoiningBuiltinSegmentWorks() {
|
|||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(php_version php_version_joined)
|
||||
alias php="echo PHP 1.2.3"
|
||||
|
||||
assertEquals "%K{013} %F{255}PHP 1.2.3 %K{013}%F{255}%F{255}PHP 1.2.3 %k%F{fuchsia}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{013} %F{255}PHP 1.2.3 %K{013}%F{255}%F{255}PHP 1.2.3 %k%F{013}%f " "$(build_left_prompt)"
|
||||
|
||||
unalias php
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ function testRightNormalSegmentsShouldNotBeJoined() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD6="echo world6"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%F{black}%f%K{white}%F{black} world2 %f%F{black}%f%K{white}%F{black} world4 %f%F{black}%f%K{white}%F{black} world6%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%F{000}%f%K{015}%F{000} world2 %f%F{000}%f%K{015}%F{000} world4 %f%F{000}%f%K{015}%F{000} world6%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightJoinedSegments() {
|
||||
|
@ -117,7 +117,7 @@ function testRightJoinedSegments() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD1="echo world1"
|
||||
local POWERLEVEL9K_CUSTOM_WORLD2="echo world2"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%K{white}%F{black}world2%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%K{015}%F{000}world2%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightTransitiveJoinedSegments() {
|
||||
|
@ -127,7 +127,7 @@ function testRightTransitiveJoinedSegments() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD2="echo world2"
|
||||
local POWERLEVEL9K_CUSTOM_WORLD3="echo world3"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%K{white}%F{black}world2 %f%K{white}%F{black}world3%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%K{015}%F{000}world2 %f%K{015}%F{000}world3%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightTransitiveJoiningWithConditionalJoinedSegment() {
|
||||
|
@ -138,7 +138,7 @@ function testRightTransitiveJoiningWithConditionalJoinedSegment() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD4="echo world4"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%K{white}%F{black}world2 %f%K{white}%F{black}world4%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%K{015}%F{000}world2 %f%K{015}%F{000}world4%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightPromotingSegmentWithConditionalPredecessor() {
|
||||
|
@ -148,7 +148,7 @@ function testRightPromotingSegmentWithConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD2="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD3="echo world3"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%F{black}%f%K{white}%F{black} world3%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%F{000}%f%K{015}%F{000} world3%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightPromotingSegmentWithJoinedConditionalPredecessor() {
|
||||
|
@ -159,7 +159,7 @@ function testRightPromotingSegmentWithJoinedConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD3="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD4="echo world4"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%F{black}%f%K{white}%F{black} world4%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%F{000}%f%K{015}%F{000} world4%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightPromotingSegmentWithDeepJoinedConditionalPredecessor() {
|
||||
|
@ -172,7 +172,7 @@ function testRightPromotingSegmentWithDeepJoinedConditionalPredecessor() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD5="echo " # Print nothing to simulate unmet conditions
|
||||
local POWERLEVEL9K_CUSTOM_WORLD6="echo world6"
|
||||
|
||||
assertEquals "%F{white}%f%K{white}%F{black} world1 %f%F{black}%f%K{white}%F{black} world4 %f%K{white}%F{black}world6%E" "$(build_right_prompt)"
|
||||
assertEquals "%F{015}%f%K{015}%F{000} world1 %f%F{000}%f%K{015}%F{000} world4 %f%K{015}%F{000}world6%E" "$(build_right_prompt)"
|
||||
}
|
||||
|
||||
function testRightJoiningBuiltinSegmentWorks() {
|
||||
|
|
|
@ -22,7 +22,7 @@ function testSegmentOnRightSide() {
|
|||
powerlevel9k_prepare_prompts
|
||||
|
||||
local reset_attributes=$'\e[00m'
|
||||
assertEquals "%f%b%k%F{white}%f%K{white}%F{black} world1 %f%F{black}%f%K{white}%F{black} world2%E%{${reset_attributes}%}" "${(e)RPROMPT}"
|
||||
assertEquals "%f%b%k%F{015}%f%K{015}%F{000} world1 %f%F{000}%f%K{015}%F{000} world2%E%{${reset_attributes}%}" "${(e)RPROMPT}"
|
||||
}
|
||||
|
||||
function testDisablingRightPrompt() {
|
||||
|
@ -48,7 +48,7 @@ function testLeftMultilinePrompt() {
|
|||
powerlevel9k_prepare_prompts
|
||||
|
||||
local nl=$'\n'
|
||||
assertEquals "╭─%f%b%k%K{white} %F{black}world1 %k%F{white}%f ${nl}╰─ " "${(e)PROMPT}"
|
||||
assertEquals "╭─%f%b%k%K{015} %F{000}world1 %k%F{015}%f ${nl}╰─ " "${(e)PROMPT}"
|
||||
}
|
||||
|
||||
function testRightPromptOnSameLine() {
|
||||
|
@ -70,7 +70,7 @@ function testRightPromptOnSameLine() {
|
|||
startSkipping
|
||||
|
||||
powerlevel9k_prepare_prompts
|
||||
assertEquals "%{\e[1A%}%F{white}%f%K{white}%F{black} world1 %f%{\e[1B%}" "${(e)RPROMPT}"
|
||||
assertEquals "%{\e[1A%}%F{015}%f%K{015}%F{000} world1 %f%{\e[1B%}" "${(e)RPROMPT}"
|
||||
}
|
||||
|
||||
function testPrefixingFirstLineOnLeftPrompt() {
|
||||
|
@ -84,7 +84,7 @@ function testPrefixingFirstLineOnLeftPrompt() {
|
|||
powerlevel9k_prepare_prompts
|
||||
|
||||
local nl=$'\n'
|
||||
assertEquals "XXX%f%b%k%K{white} %F{black}world1 %k%F{white}%f ${nl}╰─ " "${(e)PROMPT}"
|
||||
assertEquals "XXX%f%b%k%K{015} %F{000}world1 %k%F{015}%f ${nl}╰─ " "${(e)PROMPT}"
|
||||
}
|
||||
|
||||
function testPrefixingSecondLineOnLeftPrompt() {
|
||||
|
@ -98,7 +98,7 @@ function testPrefixingSecondLineOnLeftPrompt() {
|
|||
powerlevel9k_prepare_prompts
|
||||
|
||||
local nl=$'\n'
|
||||
assertEquals "╭─%f%b%k%K{white} %F{black}world1 %k%F{white}%f ${nl}XXX" "${(e)PROMPT}"
|
||||
assertEquals "╭─%f%b%k%K{015} %F{000}world1 %k%F{015}%f ${nl}XXX" "${(e)PROMPT}"
|
||||
}
|
||||
|
||||
source shunit2/shunit2
|
||||
|
|
|
@ -18,7 +18,7 @@ function testOverwritingIconsWork() {
|
|||
local POWERLEVEL9K_CUSTOM_WORLD1='echo world1'
|
||||
local POWERLEVEL9K_CUSTOM_WORLD1_ICON='icon-here'
|
||||
|
||||
assertEquals "%K{white} %F{black%}icon-here %f%F{black}world1 %k%F{white}%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{white} %F{black%}icon-here %f%F{black}world1 %k%F{white}%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{white}%f%K{white}%F{black} world1%F{black%} 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() {
|
||||
|
@ -44,7 +44,7 @@ function testVisualIdentifierPrintsNothingIfNotAvailable() {
|
|||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world1)
|
||||
local POWERLEVEL9K_CUSTOM_WORLD1='echo world1'
|
||||
|
||||
assertEquals "%K{white} %F{black}world1 %k%F{white}%f " "$(build_left_prompt)"
|
||||
assertEquals "%K{015} %F{000}world1 %k%F{015}%f " "$(build_left_prompt)"
|
||||
}
|
||||
|
||||
source shunit2/shunit2
|
Loading…
Add table
Add a link
Reference in a new issue