From 6cac732141a35a6e3c85c1bfaac4e9c43e964f27 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 20 Jan 2015 23:46:29 -0800 Subject: [PATCH] Including this omitted test. --- ..."nvm use iojs\" uses latest io.js version" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 "test/fast/Running \"nvm use iojs\" uses latest io.js version" diff --git "a/test/fast/Running \"nvm use iojs\" uses latest io.js version" "b/test/fast/Running \"nvm use iojs\" uses latest io.js version" new file mode 100755 index 0000000..53f67fa --- /dev/null +++ "b/test/fast/Running \"nvm use iojs\" uses latest io.js version" @@ -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; +