2012-10-11 07:17:09 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2018-06-14 01:38:19 +08:00
|
|
|
\. ../../common.sh
|
2012-10-11 07:17:09 +08:00
|
|
|
|
2018-06-14 01:38:19 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
|
|
|
|
|
|
|
make_fake_node v0.0.1
|
|
|
|
make_fake_node v0.0.3
|
|
|
|
make_fake_node v0.0.9
|
|
|
|
make_fake_node v0.3.1
|
|
|
|
make_fake_node v0.3.3
|
|
|
|
make_fake_node v0.3.9
|
|
|
|
make_fake_node v0.12.87
|
|
|
|
make_fake_node v0.12.9
|
|
|
|
make_fake_iojs v0.1.2
|
|
|
|
make_fake_iojs v0.10.2
|
2012-10-11 07:17:09 +08:00
|
|
|
|
|
|
|
# The result should contain the version numbers.
|
2018-06-14 01:38:19 +08:00
|
|
|
nvm ls | grep v0.0.1 >/dev/null || die "v0.0.1 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.0.3 >/dev/null || die "v0.0.3 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.0.9 >/dev/null || die "v0.0.9 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.3.1 >/dev/null || die "v0.3.1 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.3.3 >/dev/null || die "v0.3.3 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.3.9 >/dev/null || die "v0.3.9 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep v0.12.87 >/dev/null || die "v0.12.87 not found in: $(nvm ls)"
|
|
|
|
nvm ls | grep iojs-v0.1.2 >/dev/null || die "iojs-v0.1.2 not found in: $(nvm ls)"
|
2019-02-24 07:02:31 +08:00
|
|
|
|
|
|
|
OUTPUT="$(nvm_ls)"
|
|
|
|
EXPECTED_OUTPUT="v0.0.1
|
|
|
|
v0.0.3
|
|
|
|
v0.0.9
|
|
|
|
iojs-v0.1.2
|
|
|
|
v0.3.1
|
|
|
|
v0.3.3
|
|
|
|
v0.3.9
|
|
|
|
iojs-v0.10.2
|
|
|
|
v0.12.9
|
2019-02-27 17:50:59 +08:00
|
|
|
v0.12.87"
|
2019-02-24 07:02:31 +08:00
|
|
|
if nvm_has_system_node || nvm_has_system_iojs; then
|
|
|
|
EXPECTED_OUTPUT="${EXPECTED_OUTPUT}
|
|
|
|
system"
|
|
|
|
fi
|
|
|
|
[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
|