From e7cbcc5187c99e236192c1e3801bef54fd682c21 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 4 Aug 2018 22:57:06 +0200 Subject: [PATCH] Fix tests --- test/segments/battery.spec | 4 ++++ test/segments/context.spec | 2 ++ 2 files changed, 6 insertions(+) diff --git a/test/segments/battery.spec b/test/segments/battery.spec index 4f81eaec..754de3cf 100755 --- a/test/segments/battery.spec +++ b/test/segments/battery.spec @@ -158,6 +158,10 @@ function testBatterySegmentIfBatteryIsNormalWithAcpiEnabledOnLinux() { assertEquals "%K{black} %F{white%}🔋 %f%F{white}50%% (1:38) " "$(prompt_battery left 1 false ${FOLDER})" unalias date &>/dev/null + # unaliasing date fails where it was never aliased (e.g. on Linux). + # This causes the whole test to fail, because the return code is + # non-zero. + return 0 } function testBatterySegmentIfBatteryIsCalculatingWithAcpiEnabledOnLinux() { diff --git a/test/segments/context.spec b/test/segments/context.spec index 0805474f..987c3899 100755 --- a/test/segments/context.spec +++ b/test/segments/context.spec @@ -16,6 +16,8 @@ function setUp() { function tearDown() { # Restore old variables [[ -n "$OLD_DEFAULT_USER" ]] && DEFAULT_USER=$OLD_DEFAULT_USER + + return 0 } function testContextSegmentDoesNotGetRenderedWithDefaultUser() {