2014-10-22 16:48:02 +08:00
|
|
|
#!/bin/sh
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../common.sh
|
2014-10-22 16:48:02 +08:00
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../../nvm.sh
|
2014-10-22 16:48:02 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_alias loopback | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_alias loopback was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias loopback | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
EXPECTED_OUTPUT="loopback -> loopback (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias loopback was not $EXPECTED_OUTPUT; got $OUTPUT"
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_alias one | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_alias one was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias one | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
EXPECTED_OUTPUT="one -> two (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias one was not $EXPECTED_OUTPUT; got $OUTPUT"
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_alias two | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_alias two was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias two | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
EXPECTED_OUTPUT="two -> three (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias two was not $EXPECTED_OUTPUT; got $OUTPUT"
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_alias three | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_alias three was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias three | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
EXPECTED_OUTPUT="three -> one (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias three was not $EXPECTED_OUTPUT; got $OUTPUT"
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_alias four | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_alias four was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias four | strip_colors)"
|
2014-10-22 16:48:02 +08:00
|
|
|
EXPECTED_OUTPUT="four -> two (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias four was not $EXPECTED_OUTPUT; got $OUTPUT"
|