From 9daf26f0a00f593eb6f713e5e7908def85046f69 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 25 Feb 2019 13:17:10 -0800 Subject: [PATCH] [Tests] `nvm_command_info`: make error output more helpful --- test/fast/Unit tests/nvm_command_info | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/fast/Unit tests/nvm_command_info b/test/fast/Unit tests/nvm_command_info index 625e550..6eebefc 100755 --- a/test/fast/Unit tests/nvm_command_info +++ b/test/fast/Unit tests/nvm_command_info @@ -46,9 +46,13 @@ WGET_EXPECTED_INFO="$(type wget)" cleanup # 4. nvm_command_info() should not have standard error -nvm_command_info ls 2>&1 >/dev/null | grep . && die "\`nvm_command_info ls\` should not return standard error message(stage 4)" -nvm_command_info rm 2>&1 >/dev/null | grep . && die "\`nvm_command_info rm\` should not return standard error message(stage 4)" -nvm_command_info git 2>&1 >/dev/null | grep . && die "\`nvm_command_info git\` should not return standard error message(stage 4)" -nvm_command_info grep 2>&1 >/dev/null | grep . && die "\`nvm_command_info grep\` should not return standard error message(stage 4)" +OUTPUT="$(nvm_command_info ls 2>&1 >/dev/null)" +[ -z "${OUTPUT}" ] || die "\`nvm_command_info ls\` expected no stderr; got >${OUTPUT}< (stage 4)" +OUTPUT="$(nvm_command_info rm 2>&1 >/dev/null)" +[ -z "${OUTPUT}" ] || die "\`nvm_command_info rm\` expected no stderr; got >${OUTPUT}< (stage 4)" +OUTPUT="$(nvm_command_info git 2>&1 >/dev/null)" +[ -z "${OUTPUT}" ] || die "\`nvm_command_info git\` expected no stderr; got >${OUTPUT}< (stage 4)" +OUTPUT="$(nvm_command_info grep 2>&1 >/dev/null)" +[ -z "${OUTPUT}" ] || die "\`nvm_command_info grep\` expected no stderr; got >${OUTPUT}< (stage 4)" cleanup