2014-09-29 13:36:02 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2014-09-29 13:36:02 +08:00
|
|
|
|
2015-02-11 06:41:45 +08:00
|
|
|
EXPECTED_MSG="Only implicit aliases 'stable', 'unstable', 'iojs', and 'node' are supported."
|
2014-09-29 13:36:02 +08:00
|
|
|
[ "_$(nvm_validate_implicit_alias 2>&1)" = "_$EXPECTED_MSG" ] \
|
2015-02-11 06:41:45 +08:00
|
|
|
|| die "nvm_validate_implicit_alias did not require stable|unstable|iojs|node"
|
2014-09-29 13:36:02 +08:00
|
|
|
[ "_$(nvm_validate_implicit_alias foo 2>&1)" = "_$EXPECTED_MSG" ] \
|
2015-02-11 06:41:45 +08:00
|
|
|
|| die "nvm_validate_implicit_alias did not require stable|unstable|iojs|node"
|
2014-09-29 13:36:02 +08:00
|
|
|
|
|
|
|
EXIT_CODE="$(nvm_validate_implicit_alias >/dev/null 2>&1 ; echo $?)"
|
|
|
|
[ "_$EXIT_CODE" = "_1" ] \
|
2015-02-11 06:41:45 +08:00
|
|
|
|| die "nvm_validate_implicit_alias without stable|unstable|iojs|node had wrong exit code: expected 1, got $EXIT_CODE"
|
2014-09-29 13:36:02 +08:00
|
|
|
|
|
|
|
nvm_validate_implicit_alias stable || die "nvm_validate_implicit_alias stable did not exit 0"
|
|
|
|
nvm_validate_implicit_alias unstable || die "nvm_validate_implicit_alias unstable did not exit 0"
|
2015-02-11 06:41:45 +08:00
|
|
|
nvm_validate_implicit_alias node || die "nvm_validate_implicit_alias node did not exit 0"
|
|
|
|
nvm_validate_implicit_alias iojs || die "nvm_validate_implicit_alias iojs did not exit 0"
|
2014-09-29 13:36:02 +08:00
|
|
|
|