2015-01-22 19:20:09 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
|
|
|
\. ../../common.sh
|
2015-01-22 19:20:09 +08:00
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2015-01-22 19:20:09 +08:00
|
|
|
|
|
|
|
if [ -n "$ZSH_VERSION" ]; then
|
|
|
|
# set clobber option in order to test that this does not produce any
|
|
|
|
# incompatibilities
|
|
|
|
setopt noclobber
|
|
|
|
fi
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
nvm alias test-stable-1 0.0.2 || die '`nvm alias test-stable-1 0.0.2` failed'
|
2015-01-22 19:20:09 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias test-stable-1 | strip_colors)"
|
|
|
|
EXPECTED_OUTPUT='test-stable-1 -> 0.0.2 (-> v0.0.2)'
|
|
|
|
echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.2 did not set test-stable-1 to 0.0.2: got '$OUTPUT'"
|
2015-01-22 19:20:09 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
nvm alias test-stable-1 0.0.1 || die '`nvm alias test-stable-1 0.0.1` failed'
|
2015-01-22 19:20:09 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias test-stable-1 | strip_colors)"
|
|
|
|
EXPECTED_OUTPUT='test-stable-1 -> 0.0.1 (-> v0.0.1)'
|
|
|
|
echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.1 did not set test-stable-1 to 0.0.1: got '$OUTPUT'"
|