Skip to content

Commit

Permalink
Enhance test script output
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebradil committed Oct 14, 2021
1 parent af6c223 commit cb17826
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export XDG_CONFIG_DIRS="$(dirname -- "${BASH_SOURCE[0]}")/.config"

LOG_FILE=/tmp/powerline-error.log

if [[ "$(powerline shell right | tee $LOG_FILE | fgrep -c $TASK_TEXT)" -eq 1 ]]; then
exit 0
else
if [[ "$(powerline shell right | tee $LOG_FILE | fgrep -c $TASK_TEXT)" -ne 1 ]]; then
echo -e "\033[1;31m======== TEST FAILED ========\033[0m"
echo The output expected to contain "$TASK_TEXT"
echo The following was printed instead:
cat $LOG_FILE
echo
exit 1
fi

echo -e "\033[1;32m======== TEST PASSED ========\033[0m"

0 comments on commit cb17826

Please sign in to comment.