From 16e5e14af747bb310dabd367648b5566cd2edc6b Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 19 Jul 2018 22:39:19 +0200 Subject: Fix tests on older ZSH versions --- test/segments/anaconda.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/segments/anaconda.spec') diff --git a/test/segments/anaconda.spec b/test/segments/anaconda.spec index 11add849..da87c096 100755 --- a/test/segments/anaconda.spec +++ b/test/segments/anaconda.spec @@ -13,7 +13,8 @@ function setUp() { function testAnacondaSegmentPrintsNothingIfNoAnacondaPathIsSet() { local POWERLEVEL9K_CUSTOM_WORLD='echo world' - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda custom_world) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda custom_world) # Unset anacona variables unset CONDA_ENV_PATH unset CONDA_PREFIX @@ -24,7 +25,8 @@ function testAnacondaSegmentPrintsNothingIfNoAnacondaPathIsSet() { function testAnacondaSegmentWorksIfOnlyAnacondaPathIsSet() { CONDA_ENV_PATH=/tmp unset CONDA_PREFIX - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) local POWERLEVEL9K_PYTHON_ICON="icon-here" assertEquals "%K{blue} %F{black%}icon-here %f%F{black}(tmp) %k%F{blue}%f " "$(build_left_prompt)" @@ -33,7 +35,8 @@ function testAnacondaSegmentWorksIfOnlyAnacondaPathIsSet() { function testAnacondaSegmentWorksIfOnlyAnacondaPrefixIsSet() { unset CONDA_ENV_PATH local CONDA_PREFIX="test" - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) local POWERLEVEL9K_PYTHON_ICON="icon-here" assertEquals "%K{blue} %F{black%}icon-here %f%F{black}(test) %k%F{blue}%f " "$(build_left_prompt)" @@ -42,7 +45,8 @@ function testAnacondaSegmentWorksIfOnlyAnacondaPrefixIsSet() { function testAnacondaSegmentWorks() { local CONDA_ENV_PATH=/tmp local CONDA_PREFIX="test" - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda) local POWERLEVEL9K_PYTHON_ICON="icon-here" assertEquals "%K{blue} %F{black%}icon-here %f%F{black}(tmptest) %k%F{blue}%f " "$(build_left_prompt)" -- cgit v1.2.3