aboutsummaryrefslogtreecommitdiff
path: root/testlib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testlib.sh')
-rw-r--r--testlib.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/testlib.sh b/testlib.sh
index 533fd94..e65b257 100644
--- a/testlib.sh
+++ b/testlib.sh
@@ -58,13 +58,13 @@ expect_fail() {
expect_output() {
# run the test in subshell
- local val
- val="$1";
- shift
- if [ $( "$@" ) = "$1" ]; then
+ local val result
+ val="$1"; shift
+ result="$( ( "$@" 2>&1 ) )"|| true
+ if [ "${result}" = "${val}" ]; then
testlib_echo "OK" "$1"
else
- testlib_echo "FAIL" "$1"
+ testlib_echo "FAIL" "$1 reason: [${result}] != [${val}]"
fi
}