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/detect_virt.spec | |
parent | 4b32b2c0b246e65529e8e055c63be8d58be15f95 (diff) |
Fix tests on older ZSH versions
Diffstat (limited to 'test/segments/detect_virt.spec')
-rwxr-xr-x | test/segments/detect_virt.spec | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/segments/detect_virt.spec b/test/segments/detect_virt.spec index efda6f43..f6cc2ee5 100755 --- a/test/segments/detect_virt.spec +++ b/test/segments/detect_virt.spec @@ -12,10 +12,11 @@ function setUp() { } function testDetectVirtSegmentPrintsNothingIfSystemdIsNotAvailable() { + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt custom_world) + local POWERLEVEL9K_CUSTOM_WORLD='echo world' alias systemd-detect-virt="novirt" - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt custom_world) - local POWERLEVEL9K_CUSTOM_WORLD='echo world' assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)" @@ -23,7 +24,8 @@ function testDetectVirtSegmentPrintsNothingIfSystemdIsNotAvailable() { } function testDetectVirtSegmentIfSystemdReturnsPlainName() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) alias systemd-detect-virt="echo 'xxx'" assertEquals "%K{black} %F{yellow}xxx %k%F{black}%f " "$(build_left_prompt)" @@ -32,7 +34,8 @@ function testDetectVirtSegmentIfSystemdReturnsPlainName() { } function testDetectVirtSegmentIfRootFsIsOnExpectedInode() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) # Well. This is a weak test, as it fixates the implementation, # but it is necessary, as the implementation relys on the root # directory having the inode number "2".. @@ -49,7 +52,8 @@ function testDetectVirtSegmentIfRootFsIsOnExpectedInode() { } function testDetectVirtSegmentIfRootFsIsNotOnExpectedInode() { - local POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) + local -a POWERLEVEL9K_LEFT_PROMPT_ELEMENTS + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt) # Well. This is a weak test, as it fixates the implementation, # but it is necessary, as the implementation relys on the root # directory having the inode number "2".. |