2012-10-11 07:17:09 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2012-10-11 07:17:09 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
mkdir "${NVM_DIR}/v0.1.3"
|
|
|
|
mkdir "${NVM_DIR}/v0.2.3"
|
|
|
|
mkdir "${NVM_DIR}/v0.20.3"
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-06-17 13:59:56 +08:00
|
|
|
|
2012-10-11 07:17:09 +08:00
|
|
|
# The result should contain only the appropriate version numbers.
|
2014-06-17 13:59:56 +08:00
|
|
|
|
|
|
|
nvm ls 0.1 | grep 'v0.2.3' > /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo '"nvm ls 0.1" contained v0.2.3'
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvm ls 0.1 | grep 'v0.20.3' > /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
die '"nvm ls 0.1" contained v0.20.3'
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvm ls 0.1 | grep 'v0.1.3' > /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
die '"nvm ls 0.1" did not contain v0.1.3'
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvm ls 0.2 | grep 'v0.2.3' > /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
die '"nvm ls 0.2" did not contain v0.2.3'
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvm ls 0.2 | grep 'v0.20.3' > /dev/null
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
die '"nvm ls 0.2" contained v0.20.3'
|
|
|
|
fi
|
|
|
|
|
|
|
|
nvm ls 0.2 | grep 'v0.2.3' > /dev/null
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
die '"nvm ls 0.2" did not contain v0.2.3'
|
|
|
|
fi
|