![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/.nvm/test/fast/Unit tests/ |
#!/bin/sh die () { echo "$@" ; cleanup ; exit 1; } cleanup() { unset -f nvm_download } \. ../../../nvm.sh set -ex MOCKS_DIR="${PWD}/mocks" # sample output at the time the test was written TAB_PATH="${MOCKS_DIR}/nodejs.org-dist-index.tab" nvm_download() { cat "${TAB_PATH}" } nvm_ls_remote >/dev/null || die "nvm_ls_remote_failed?!" LTS_NAMES_PATH="${MOCKS_DIR}/LTS_names.txt" N=0 while IFS= read -r LTS; do if [ $N -gt 0 ]; then EXPECTED="$(nvm_alias "lts/${LTS}")" ACTUAL="$(nvm_alias "lts/-${N}")" [ "${EXPECTED}" = "${ACTUAL}" ] || die "\`nvm_alias lts/-${N}\` was \`${ACTUAL}\`; expected \`${EXPECTED}\`" fi N=$(($N+1)) done < "${LTS_NAMES_PATH}" cleanup