aboutsummaryrefslogtreecommitdiff
path: root/test/segments/detect_virt.spec
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-25 08:52:06 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-25 08:52:06 +0300
commit06de83cc0f2282b2217c6151277dfd6789593c2e (patch)
tree8e7d013b2f66f9431b732f64fe8c8c5c8a87e7c5 /test/segments/detect_virt.spec
parent99f0eddd62806f99b8116e3f327689bc32529d5d (diff)
Prepare tests for performance optimizations
Diffstat (limited to 'test/segments/detect_virt.spec')
-rwxr-xr-xtest/segments/detect_virt.spec12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/segments/detect_virt.spec b/test/segments/detect_virt.spec
index 2dad6af0..7df92a24 100755
--- a/test/segments/detect_virt.spec
+++ b/test/segments/detect_virt.spec
@@ -17,6 +17,9 @@ function testDetectVirtSegmentPrintsNothingIfSystemdIsNotAvailable() {
local POWERLEVEL9K_CUSTOM_WORLD='echo world'
alias systemd-detect-virt="novirt"
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{white} %F{black}world %k%F{white}%f " "$(build_left_prompt)"
unalias systemd-detect-virt
@@ -27,6 +30,9 @@ function testDetectVirtSegmentIfSystemdReturnsPlainName() {
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(detect_virt)
alias systemd-detect-virt="echo 'xxx'"
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
assertEquals "%K{black} %F{yellow}xxx %k%F{black}%f " "$(build_left_prompt)"
unalias systemd-detect-virt
@@ -40,6 +46,9 @@ function testDetectVirtSegmentIfRootFsIsOnExpectedInode() {
# directory having the inode number "2"..
alias systemd-detect-virt="echo 'none'"
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
# The original command in the implementation is "ls -di / | grep -o 2",
# which translates to: Show the inode number of "/" and test if it is "2".
alias ls="echo '2'"
@@ -58,6 +67,9 @@ function testDetectVirtSegmentIfRootFsIsNotOnExpectedInode() {
# directory having the inode number "2"..
alias systemd-detect-virt="echo 'none'"
+ # Load Powerlevel9k
+ source powerlevel9k.zsh-theme
+
# The original command in the implementation is "ls -di / | grep -o 2",
# which translates to: Show the inode number of "/" and test if it is "2".
alias ls="echo '3'"