Skip to content

Instantly share code, notes, and snippets.

@dseg
Created September 3, 2015 11:26
Show Gist options
  • Select an option

  • Save dseg/f1b0354f68c6660eb90a to your computer and use it in GitHub Desktop.

Select an option

Save dseg/f1b0354f68c6660eb90a to your computer and use it in GitHub Desktop.
--- shunit2 2011-05-01 20:10:33.000000000 +0000
+++ shunit2-color 2015-09-03 11:23:08.854549999 +0000
@@ -829,18 +829,18 @@
&& _shunit_skipped_="skipped=${__shunit_assertsSkipped}"
if [ ${_shunit_ok_} -eq ${SHUNIT_TRUE} ]; then
- _shunit_msg_='OK'
+ _shunit_msg_="\033[32;1mOK\033[0m\n"
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_} (${_shunit_skipped_})"
else
- _shunit_msg_="FAILED (${_shunit_failures_}"
+ _shunit_msg_="\033[31;1mFAILED (${_shunit_failures_}"
[ -n "${_shunit_skipped_}" ] \
&& _shunit_msg_="${_shunit_msg_},${_shunit_skipped_}"
- _shunit_msg_="${_shunit_msg_})"
+ _shunit_msg_="${_shunit_msg_})\033[0m\n"
fi
echo
- echo ${_shunit_msg_}
+ printf '%b' "${_shunit_msg_}"
__shunit_reportGenerated=${SHUNIT_TRUE}
unset _shunit_failures_ _shunit_msg_ _shunit_ok_ _shunit_skipped_
@dseg
Copy link
Author

dseg commented Sep 3, 2015

Tested with dash and bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment