nvm/test/fast/Unit tests
Oliver Henshaw 15eba7b7e6
[Fix] nvm_strip_path: Preserve leading/trailing colons
Path lists in environmental variables often give special meaning to
empty entries (e.g. in PATH or MANPATH). These are represented by
leading or trailing colons, or by doubled colons in the middle of the
list.

Adjust the awk invocation to correctly deal with trailing colons by
printing the separator before every field except the first, and then
printing the final separator that is read from the input - this will
either be a colon or the null string. This preserves leading and
trailing colons in all cases while not adding extra colons in the wrong
place.

Add test to confirm the correct behaviour.

Fixes #3144
2023-06-21 15:47:52 +01:00
..
mocks
nvm ls-remote [Tests] fix failing test 2021-12-17 13:21:29 -08:00
nvm set_colors [New] Added set-colors command. See details below: 2020-08-17 14:56:13 -07:00
nvm version-remote [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_add_iojs_prefix [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_alias
nvm_alias LTS-N [Fix] nvm_alias: ensure lts/-1 returns the one before lts/* 2021-03-11 16:22:31 -05:00
nvm_alias_path [Docs] fix spelling 2018-03-06 04:38:01 +00:00
nvm_change_path [meta] update repo links to point to org 2019-04-24 16:08:34 -07:00
nvm_check_for_help
nvm_clang_version
nvm_command_info [Tests] nvm_command_info: make error output more helpful 2019-02-25 13:17:10 -08:00
nvm_compare_checksum
nvm_compute_checksum
nvm_curl_libz_support
nvm_curl_use_compression [Fix] enable curl compression only on curl >=7.21.0 2017-06-10 15:25:26 +08:00
nvm_curl_version
nvm_die_on_prefix [Fix] nvm_die_on_prefix: filter prefixed env vars on name only, ignoring values 2020-11-28 15:16:35 +01:00
nvm_download [meta] use HEAD instead of master where possible 2022-12-23 12:53:40 -08:00
nvm_download_artifact
nvm_ensure_default_set
nvm_ensure_version_installed [Fix] nvm install: show proper version in .nvmrc install instructions 2022-03-22 18:58:18 +05:30
nvm_ensure_version_prefix [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_extract_tarball
nvm_find_project_dir [Fix] fix directory traversal when workdir path is not readable 2023-04-08 17:24:41 +01:00
nvm_find_up [Fix] fix directory traversal when workdir path is not readable 2023-04-08 17:24:41 +01:00
nvm_format_version
nvm_get_arch [Fix] fix node download link for armv8l 2023-04-29 16:41:31 -07:00
nvm_get_artifact_compression
nvm_get_checksum [Refactor] add nvm_get_artifact_compression 2021-01-02 00:03:24 +01:00
nvm_get_checksum_alg
nvm_get_checksum_binary [Refactor] add nvm_get_checksum_binary; use it in nvm debug 2020-07-31 22:13:21 -07:00
nvm_get_colors
nvm_get_default_packages
nvm_get_download_slug
nvm_get_latest missing curl or wget
nvm_get_minor_version
nvm_get_mirror [New] add support for $NVM_DIR/default-packages file 2017-03-28 09:37:14 -07:00
nvm_has Remove useless trailing newlines 2018-02-26 01:01:30 +08:00
nvm_has_non_aliased [Refactor] Add nvm_has_non_aliased 2017-03-20 16:57:26 +08:00
nvm_has_solaris_binary [Docs] fix spelling 2018-03-06 04:38:01 +00:00
nvm_has_system_iojs [Tests] update most mkdirs to use make_fake_{node,iojs} 2018-06-13 10:38:19 -07:00
nvm_has_system_node
nvm_install_binary_extract [New] maybe support Windows with WSL, MSYS, Cygwin 2021-01-02 00:03:24 +01:00
nvm_install_binary_nosource [New] install: add -b flag to skip building from source 2021-02-16 19:34:23 +05:30
nvm_install_latest_npm [New] nvm install: add --latest-npm option to automatically try to upgrade to the latest working version of npm. 2017-06-11 14:15:04 -07:00
nvm_install_no_progress_bar
nvm_iojs_prefix [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_iojs_version_has_solaris_binary
nvm_is_alias [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_is_iojs_version [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_is_merged_node_version
nvm_is_natural_num [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_is_valid_version [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_is_version_installed [New] maybe support Windows with WSL, MSYS, Cygwin 2021-01-02 00:03:24 +01:00
nvm_ls_current
nvm_ls_remote
nvm_ls_remote LTS aliases
nvm_ls_remote nightly
nvm_ls_remote_iojs
nvm_make_alias [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_node_prefix [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_node_version_has_solaris_binary [Refactor] Rename solaris and iojs helper functions to be nvm_ prefixed 2020-05-08 16:08:27 -04:00
nvm_normalize_lts [Tests] fix failing test 2021-12-17 13:21:29 -08:00
nvm_num_version_groups
nvm_print_alias_path
nvm_print_color_code
nvm_print_default_alias [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
nvm_print_implicit_alias errors
nvm_print_implicit_alias success
nvm_print_npm_version
nvm_remote_version
nvm_remote_versions
nvm_stdout_is_terminal
nvm_strip_iojs_prefix
nvm_strip_path [Fix] nvm_strip_path: Preserve leading/trailing colons 2023-06-21 15:47:52 +01:00
nvm_supports_xz
nvm_tree_contains_path
nvm_use_if_needed
nvm_validate_implicit_alias
nvm_version
nvm_version_dir
nvm_version_greater
nvm_version_path
nvm_wrap_with_color_code