diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2018-07-19 23:39:19 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2018-07-19 23:39:19 +0300 |
commit | 16e5e14af747bb310dabd367648b5566cd2edc6b (patch) | |
tree | 9593ab0319da9f99bbc5dd29d437b092a806bfb7 /test/segments/vcs-hg.spec | |
parent | 4b32b2c0b246e65529e8e055c63be8d58be15f95 (diff) |
Fix tests on older ZSH versions
Diffstat (limited to 'test/segments/vcs-hg.spec')
-rwxr-xr-x | test/segments/vcs-hg.spec | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/test/segments/vcs-hg.spec b/test/segments/vcs-hg.spec index 6d8c6428..91d25ae6 100755 --- a/test/segments/vcs-hg.spec +++ b/test/segments/vcs-hg.spec @@ -34,7 +34,8 @@ function tearDown() { } function testColorOverridingForCleanStateWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_CLEAN_FOREGROUND='cyan' local POWERLEVEL9K_VCS_CLEAN_BACKGROUND='white' @@ -42,7 +43,8 @@ function testColorOverridingForCleanStateWorks() { } function testColorOverridingForModifiedStateWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='red' local POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow' @@ -60,7 +62,8 @@ function testColorOverridingForModifiedStateWorks() { # This may be improved in future versions, to be a bit more consistent with # the git part. function testAddedFilesIconWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) touch "myfile.txt" hg add myfile.txt @@ -70,7 +73,8 @@ function testAddedFilesIconWorks() { # We don't support tagging in mercurial right now.. function testTagIconWorks() { startSkipping # Skip test - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_TAG_ICON='T' touch "file.txt" @@ -83,7 +87,8 @@ function testTagIconWorks() { function testTagIconInDetachedHeadState() { startSkipping # Skip test - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_TAG_ICON='T' touch "file.txt" @@ -100,7 +105,8 @@ function testTagIconInDetachedHeadState() { } function testActionHintWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) touch "i-am-modified.txt" hg add i-am-modified.txt hg commit -m "Add File" &>/dev/null @@ -119,7 +125,8 @@ function testActionHintWorks() { } function testShorteningCommitHashWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_SHOW_CHANGESET=true local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' @@ -136,7 +143,8 @@ function testShorteningCommitHashWorks() { } function testShorteningCommitHashIsNotShownIfShowChangesetIsFalse() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_SHOW_CHANGESET=false local POWERLEVEL9K_CHANGESET_HASH_LENGTH='4' @@ -152,14 +160,16 @@ function testShorteningCommitHashIsNotShownIfShowChangesetIsFalse() { } function testMercurialIconWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_HG_ICON='HG-Icon' assertEquals "%K{green} %F{black%}HG-Icon %f%F{black} default %k%F{green}%f " "$(build_left_prompt)" } function testBookmarkIconWorks() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(vcs) local POWERLEVEL9K_VCS_BOOKMARK_ICON='B' hg bookmark "initial" |