2015-02-22 05:51:07 +08:00
|
|
|
#!/bin/sh
|
2016-04-28 08:05:33 +08:00
|
|
|
. ../../../common.sh
|
2015-02-22 05:51:07 +08:00
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
|
|
|
. ../../../../nvm.sh
|
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
ALIAS="$(nvm_resolve_local_alias loopback | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_local_alias loopback was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias loopback | strip_colors)"
|
2015-02-22 05:51:07 +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_local_alias one | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_local_alias one was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias one | strip_colors)"
|
2015-02-22 05:51:07 +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_local_alias two | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_local_alias two was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias two | strip_colors)"
|
2015-02-22 05:51:07 +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_local_alias three | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_local_alias three was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias three | strip_colors)"
|
2015-02-22 05:51:07 +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_local_alias four | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
[ "_$ALIAS" = "_∞" ] || die "nvm_resolve_local_alias four was not ∞; got $ALIAS"
|
2016-04-28 08:05:33 +08:00
|
|
|
OUTPUT="$(nvm alias four | strip_colors)"
|
2015-02-22 05:51:07 +08:00
|
|
|
EXPECTED_OUTPUT="four -> two (-> ∞)"
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm alias four was not $EXPECTED_OUTPUT; got $OUTPUT"
|