Adding a failing test: `nvm ls 0.0.x` includes `v0.0.xy`

master
Jordan Harband 2014-09-28 10:18:00 -07:00
parent 3c66c20570
commit be605cb12b
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/bin/sh
mkdir ../../../v0.0.2
mkdir ../../../v0.0.20
. ../../../nvm.sh
die () { echo $@ ; exit 1; }
# The result should contain only the appropriate version numbers.
nvm ls 0.0.2 | grep 'v0.0.2' > /dev/null
if [ $? -eq 0 ]; then
echo '"nvm ls 0.0.2" contained v0.0.2'
fi
nvm ls 0.0.2 | grep 'v0.0.20' > /dev/null
if [ $? -eq 0 ]; then
die '"nvm ls 0.0.2" contained v0.0.20'
fi

View File

@ -1,6 +1,8 @@
rmdir ../../../v0.0.1 >/dev/null 2>&1
rmdir ../../../v0.0.2 >/dev/null 2>&1
rmdir ../../../v0.0.3 >/dev/null 2>&1
rmdir ../../../v0.0.9 >/dev/null 2>&1
rmdir ../../../v0.0.20 >/dev/null 2>&1
rmdir ../../../v0.1.2 >/dev/null 2>&1
rmdir ../../../v0.1.3 >/dev/null 2>&1
rmdir ../../../v0.2.3 >/dev/null 2>&1