Merge pull request #8661 from hercules-ci/test-reformat-error-message

tests: Reformat exit code error message
This commit is contained in:
John Ericson 2023-08-25 10:17:15 -04:00 committed by GitHub
commit dd9f816b29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ expect() {
shift
"$@" && res=0 || res="$?"
if [[ $res -ne $expected ]]; then
echo "Expected '$expected' but got '$res' while running '${*@Q}'" >&2
echo "Expected exit code '$expected' but got '$res' from command ${*@Q}" >&2
return 1
fi
return 0
@ -209,7 +209,7 @@ expectStderr() {
shift
"$@" 2>&1 && res=0 || res="$?"
if [[ $res -ne $expected ]]; then
echo "Expected '$expected' but got '$res' while running '${*@Q}'" >&2
echo "Expected exit code '$expected' but got '$res' from command ${*@Q}" >&2
return 1
fi
return 0