From 1563501868d8c2cd4b14ff44b58d6a3e8317a559 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 23 Sep 2014 22:50:28 -0700 Subject: [PATCH] Fix missing "1 test failed" line Also tweak colored output to reset before the newline instead of after, so travis behaves better (for some reason reset causes travis to display the line in black). --- tests/interactive.fish | 3 ++- tests/test_util.fish | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/interactive.fish b/tests/interactive.fish index 03ebacf73..c3c7b6090 100644 --- a/tests/interactive.fish +++ b/tests/interactive.fish @@ -74,6 +74,7 @@ if test $failed -eq 0 say green "All tests completed successfully" exit 0 else - say red "$failed test"(test $failed -eq 1; or echo s)" failed" + set plural (test $failed -eq 1; or echo s) + say red "$failed test$plural failed" exit 1 end diff --git a/tests/test_util.fish b/tests/test_util.fish index b81e17f69..659cbda47 100644 --- a/tests/test_util.fish +++ b/tests/test_util.fish @@ -14,14 +14,18 @@ end function say set -l color_flags + set -l suppress_newline while set -q argv[1] switch $argv[1] case -b -o -u set color_flags $color_flags $argv[1] + case -n + set suppress_newline 1 case -- set -e argv[1] break case -\* + continue case \* break end @@ -35,10 +39,11 @@ function say if set_color $color_flags $argv[1] set -e argv[1] - echo $argv - set -l stat $status + echo -n $argv set_color reset - or return $stat + if test -z "$suppress_newline" + echo + end end end