nvm/test/fast
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
..
Aliases [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Listing paths [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Listing versions [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Set Colors [New] Added `set-colors` command. See details below: 2020-08-17 14:56:13 -07:00
Unit tests [Fix] `nvm_strip_path`: Preserve leading/trailing colons 2023-06-21 15:47:52 +01:00
Running 'nvm alias' should create a file in the alias directory [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Running 'nvm current' should display current nvm environment [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Running 'nvm deactivate' should unset the nvm environment variables [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Running 'nvm install' with '--reinstall-packages-from' requires a valid version [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Running 'nvm install' with an invalid version fails nicely [Tests] force the NVM_DIR to the expected location, for tests 2022-12-27 21:40:48 -08:00
Running 'nvm unalias' should remove the alias file [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm uninstall' should remove the appropriate directory [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm uninstall' with incorrect file permissions fails nicely [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm unload' should unset all function and variables [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use foo' where 'foo' is circular aborts [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use iojs' uses latest io.js version [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use system' should work as expected [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use x' should create and change the 'current' symlink [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use x' should not create the 'current' symlink if $NVM_SYMLINK_CURRENT is false [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Running 'nvm use' should drop CR char automatically [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Sourcing nvm.sh should make the nvm command available [meta] Rename some files to be more cross platform 2021-01-04 00:49:05 +01:00
Sourcing nvm.sh should not modify parameters of caller [Tests] Replace all dots with backslash dots 2016-11-03 23:44:59 -07:00
nvm should remove the last trailing slash in $NVM_DIR [Fix] Remove $NVM_DIR trailing slash automatically, fix #1708 2018-04-12 14:14:58 +08:00
setup [Tests] use `-ex` option during tests when possible 2016-07-10 19:58:32 -07:00
setup_dir [Tests] use `-ex` option during tests when possible 2016-07-10 19:58:32 -07:00
teardown [Tests] use `-ex` option during tests when possible 2016-07-10 19:58:32 -07:00
teardown_dir [Tests] use `-ex` option during tests when possible 2016-07-10 19:58:32 -07:00