MMCT TEAM
Server IP : 217.21.85.138  /  Your IP : 216.73.216.103
Web Server : LiteSpeed
System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u915722082 ( 915722082)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u915722082/.nvm/test/fast/Unit tests/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u915722082/.nvm/test/fast/Unit tests/nvm_alias LTS-N
#!/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

MMCT - 2023