summaryrefslogtreecommitdiff
path: root/test/segments/custom.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-19 23:39:19 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-19 23:39:19 +0300
commit16e5e14af747bb310dabd367648b5566cd2edc6b (patch)
tree9593ab0319da9f99bbc5dd29d437b092a806bfb7 /test/segments/custom.spec
parent4b32b2c0b246e65529e8e055c63be8d58be15f95 (diff)
Fix tests on older ZSH versions
Diffstat (limited to 'test/segments/custom.spec')
-rwxr-xr-xtest/segments/custom.spec18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/segments/custom.spec b/test/segments/custom.spec
index dea1577f..261e2508 100755
--- a/test/segments/custom.spec
+++ b/test/segments/custom.spec
@@ -12,14 +12,16 @@ function setUp() {
}
function testCustomDirectOutputSegment() {
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
}
function testCustomClosureSegment() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
function p9k_hello_world() {
echo "world"
}
@@ -29,7 +31,8 @@ function testCustomClosureSegment() {
}
function testSettingBackgroundForCustomSegment() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_BACKGROUND="yellow"
@@ -37,7 +40,8 @@ function testSettingBackgroundForCustomSegment() {
}
function testSettingForegroundForCustomSegment() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_FOREGROUND="red"
@@ -45,7 +49,8 @@ function testSettingForegroundForCustomSegment() {
}
function testSettingVisualIdentifierForCustomSegment() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw"
@@ -53,7 +58,8 @@ function testSettingVisualIdentifierForCustomSegment() {
}
function testSettingVisualIdentifierForegroundColorForCustomSegment() {
- local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
+ local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
+ POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_world)
local POWERLEVEL9K_CUSTOM_WORLD="echo world"
local POWERLEVEL9K_CUSTOM_WORLD_ICON="hw"
local POWERLEVEL9K_CUSTOM_WORLD_VISUAL_IDENTIFIER_COLOR="red"