Browse Source

[Tests] `nvm_command_info`: make error output more helpful

Jordan Harband 6 years ago
parent
commit
9daf26f0a0
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
  1. 12
      test/fast/Unit tests/nvm_command_info

12
test/fast/Unit tests/nvm_command_info

@ -46,9 +46,13 @@ WGET_EXPECTED_INFO="$(type wget)" @@ -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

Loading…
Cancel
Save