mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Including this omitted test.
This commit is contained in:
parent
9ee864b06f
commit
6cac732141
22
test/fast/Running "nvm use iojs" uses latest io.js version
Executable file
22
test/fast/Running "nvm use iojs" uses latest io.js version
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; cleanup ; exit 1; }
|
||||
|
||||
cleanup() {
|
||||
rm -rf ../../alias/foo
|
||||
}
|
||||
|
||||
. ../../nvm.sh
|
||||
|
||||
echo 'foo' > ../../alias/foo
|
||||
|
||||
OUTPUT="$(nvm use foo 2>&1)"
|
||||
EXPECTED_OUTPUT='The alias "foo" leads to an infinite loop. Aborting.'
|
||||
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
||||
|| die "'nvm use foo' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|
||||
|
||||
EXIT_CODE="$(nvm use foo 2>/dev/null ; echo $?)"
|
||||
[ "_$EXIT_CODE" = "_8" ] || die "Expected exit code 8; got $EXIT_CODE"
|
||||
|
||||
cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user