blob: edddf014f0323fcae82087e2911f63a2143cf48e [file] [log] [blame]
#!/bin/sh
\. ../../../nvm.sh
mkdir "${NVM_DIR}/v0.1.3"
mkdir "${NVM_DIR}/v0.2.3"
mkdir "${NVM_DIR}/v0.20.3"
die () { echo "$@" ; exit 1; }
# The result should contain only the appropriate version numbers.
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