Browse Source

[meta] Rename some files to be more cross platform

nmarghetti 4 years ago committed by Jordan Harband
parent
commit
9849bf494d
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
  1. 4
      .editorconfig
  2. 7
      .github/workflows/lint.yml
  3. 52
      rename_test.sh
  4. 0
      test/fast/Aliases/'nvm alias' should not accept aliases with slashes
  5. 0
      test/fast/Aliases/'nvm unalias' should accept aliases when they shadow a built-in alias
  6. 0
      test/fast/Aliases/'nvm unalias' should not accept aliases with names equal to built-in alias
  7. 0
      test/fast/Aliases/'nvm unalias' should not accept aliases with slashes
  8. 0
      test/fast/Aliases/Running 'nvm alias ˂aliasname˃ ˂target˃' again should change the target
  9. 0
      test/fast/Aliases/Running 'nvm alias ˂aliasname˃' should list but one alias
  10. 0
      test/fast/Aliases/Running 'nvm alias' lists implicit aliases when they do not exist
  11. 0
      test/fast/Aliases/Running 'nvm alias' lists manual aliases instead of implicit aliases when present
  12. 0
      test/fast/Aliases/Running 'nvm alias' should list all aliases
  13. 0
      test/fast/Aliases/lts/'nvm alias' should ensure LTS alias dir exists
  14. 0
      test/fast/Listing paths/Running 'nvm which 0.0.2' should display only version 0.0.2
  15. 0
      test/fast/Listing paths/Running 'nvm which foo' should return a nonzero exit code when not found
  16. 0
      test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias
  17. 0
      test/fast/Listing versions/Running 'nvm ls --no-alias' with a pattern errors
  18. 0
      test/fast/Listing versions/Running 'nvm ls 0.0.2' should display only version 0.0.2
  19. 0
      test/fast/Listing versions/Running 'nvm ls 0.2' should display only 0.2.x versions
  20. 0
      test/fast/Listing versions/Running 'nvm ls foo' should return a nonzero exit code when not found
  21. 0
      test/fast/Listing versions/Running 'nvm ls io' should return NA
  22. 0
      test/fast/Listing versions/Running 'nvm ls node_' should return a nonzero exit code when not found
  23. 0
      test/fast/Listing versions/Running 'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias
  24. 0
      test/fast/Listing versions/Running 'nvm ls system' should include 'system' when appropriate
  25. 0
      test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias
  26. 0
      test/fast/Listing versions/Running 'nvm ls' should display all installed versions
  27. 0
      test/fast/Listing versions/Running 'nvm ls' should filter out '.nvm'
  28. 0
      test/fast/Listing versions/Running 'nvm ls' should filter out 'versions'
  29. 0
      test/fast/Listing versions/Running 'nvm ls' should include 'system' when appropriate
  30. 0
      test/fast/Listing versions/Running 'nvm ls' should list versions in the 'versions' directory
  31. 0
      test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash
  32. 0
      test/fast/Listing versions/Running 'nvm ls' with node-like versioning vx.x.x should only list a matched version
  33. 0
      test/fast/Listing versions/Running 'nvm ls' with nounset should not fail
  34. 0
      test/fast/Running 'nvm alias' should create a file in the alias directory
  35. 0
      test/fast/Running 'nvm current' should display current nvm environment
  36. 0
      test/fast/Running 'nvm deactivate' should unset the nvm environment variables
  37. 0
      test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version
  38. 0
      test/fast/Running 'nvm install' with an invalid version fails nicely
  39. 0
      test/fast/Running 'nvm unalias' should remove the alias file
  40. 0
      test/fast/Running 'nvm uninstall' should remove the appropriate directory
  41. 0
      test/fast/Running 'nvm uninstall' with incorrect file permissions fails nicely
  42. 0
      test/fast/Running 'nvm unload' should unset all function and variables
  43. 0
      test/fast/Running 'nvm use foo' where 'foo' is circular aborts
  44. 0
      test/fast/Running 'nvm use iojs' uses latest io.js version
  45. 0
      test/fast/Running 'nvm use system' should work as expected
  46. 0
      test/fast/Running 'nvm use x' should create and change the 'current' symlink
  47. 0
      test/fast/Running 'nvm use x' should not create the 'current' symlink if $NVM_SYMLINK_CURRENT is false
  48. 0
      test/fast/Running 'nvm use' should drop CR char automatically
  49. 0
      test/fast/Sourcing nvm.sh should make the nvm command available
  50. 0
      test/slow/Running 'nvm current' should display current nvm environment
  51. 0
      test/slow/nvm exec/Preamble works and respects 'silent' flag
  52. 0
      test/slow/nvm exec/Running 'nvm exec --lts' should work
  53. 0
      test/slow/nvm exec/Running 'nvm exec 0.x' should work
  54. 0
      test/slow/nvm exec/Running 'nvm exec' should pick up .nvmrc version
  55. 0
      test/slow/nvm reinstall-packages/Running 'nvm copy-packages $(nvm ls current)' should error out
  56. 0
      test/slow/nvm run/Running 'nvm run --harmony --version' should work
  57. 0
      test/slow/nvm run/Running 'nvm run --lts' should work
  58. 0
      test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed
  59. 0
      test/slow/nvm run/Running 'nvm run 0.x' should work
  60. 0
      test/slow/nvm run/Running 'nvm run' should pick up .nvmrc version
  61. 0
      test/slow/nvm uninstall/Running 'nvm uninstall 0.12.6' uninstalls v0.12.6
  62. 0
      test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely
  63. 0
      test/slow/nvm use/Running 'nvm use --lts' uses latest LTS version
  64. 0
      test/slow/nvm use/Running 'nvm use --lts=foo' uses latest 'foo' LTS version
  65. 0
      test/slow/nvm use/Running 'nvm use iojs' uses latest io.js version
  66. 0
      test/slow/nvm use/Running 'nvm use node --silent' doesn't print anything
  67. 0
      test/slow/nvm use/Running 'nvm use node' uses latest stable node version
  68. 0
      test/slow/nvm use/Running 'nvm use v1.0.0' uses iojs-v1.0.0 iojs version
  69. 0
      test/slow/nvm use/Running 'nvm use' calls 'nvm_die_on_prefix'

4
.editorconfig

@ -12,10 +12,10 @@ trim_trailing_whitespace = true @@ -12,10 +12,10 @@ trim_trailing_whitespace = true
[*.txt]
indent_size = false
[test/fast/Listing versions/Running "nvm ls" calls into nvm_alias]
[test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias]
indent_size = false
[test/fast/Listing versions/Running "nvm ls --no-alias" does not call into nvm_alias]
[test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias]
indent_size = false
[test/fast/Unit tests/mocks/**]

7
.github/workflows/lint.yml

@ -36,3 +36,10 @@ jobs: @@ -36,3 +36,10 @@ jobs:
cp README.md README.md.orig
npm run doctoc
diff -q README.md README.md.orig
test_naming:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check tests filenames
run: ./rename_test.sh --check

52
rename_test.sh

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
#! /usr/bin/env bash
find_name(){
find test -name "*[\\/:\*\?\"<>\|]*" -o -name "*."
}
check_name() {
if [ "$(find_name | wc -l)" != "0" ]; then
printf '%s\n\n' "The following filenames contain unwanted characters:"
find_name
printf '\n%s\n%s\n' "Please run ./rename_test.sh" "If the problem persist, please open an issue."
exit 1
else
echo "Ok"
fi
}
rename_test() {
local filename
local new_filename
while read -r filename; do
# Even though it looks < and > are replaced by the same < and >, the latters are not ASCII code
# If you check with 'cat -v rename_test.sh' you would see 's/</M-KM-^B/g' and 's/>/M-KM-^C/g'
# M-KM-^B -> U+02C2
# M-KM-^C -> U+02C3
new_filename=$(echo "$filename" | sed -r \
-e "s/\"/'/g" \
-e 's/</˂/g' \
-e 's/>/˃/g' \
-e 's/^(.*)\.$/\1/'
)
printf '%s\n%s\n\n' "$filename" "$new_filename"
[ "$filename" != "$new_filename" ] && git mv "$filename" "$new_filename"
done < <(find_name)
if [ "$(find_name | wc -l)" != "0" ]; then
echo "Still some files to treat:"
find_name
else
echo "Done"
fi
}
main() {
if [ "$1" = "--check" ]; then
check_name
else
rename_test
fi
}
main "$@"

0
test/fast/Aliases/"nvm alias" should not accept aliases with slashes → test/fast/Aliases/'nvm alias' should not accept aliases with slashes

0
test/fast/Aliases/"nvm unalias" should accept aliases when they shadow a built-in alias → test/fast/Aliases/'nvm unalias' should accept aliases when they shadow a built-in alias

0
test/fast/Aliases/"nvm unalias" should not accept aliases with names equal to built-in alias → test/fast/Aliases/'nvm unalias' should not accept aliases with names equal to built-in alias

0
test/fast/Aliases/"nvm unalias" should not accept aliases with slashes → test/fast/Aliases/'nvm unalias' should not accept aliases with slashes

0
test/fast/Aliases/Running "nvm alias <aliasname> <target>" again should change the target → test/fast/Aliases/Running 'nvm alias ˂aliasname˃ ˂target˃' again should change the target

0
test/fast/Aliases/Running "nvm alias <aliasname>" should list but one alias. → test/fast/Aliases/Running 'nvm alias ˂aliasname˃' should list but one alias

0
test/fast/Aliases/Running "nvm alias" lists implicit aliases when they do not exist → test/fast/Aliases/Running 'nvm alias' lists implicit aliases when they do not exist

0
test/fast/Aliases/Running "nvm alias" lists manual aliases instead of implicit aliases when present → test/fast/Aliases/Running 'nvm alias' lists manual aliases instead of implicit aliases when present

0
test/fast/Aliases/Running "nvm alias" should list all aliases. → test/fast/Aliases/Running 'nvm alias' should list all aliases

0
test/fast/Aliases/lts/"nvm alias" should ensure LTS alias dir exists → test/fast/Aliases/lts/'nvm alias' should ensure LTS alias dir exists

0
test/fast/Listing paths/Running "nvm which 0.0.2" should display only version 0.0.2. → test/fast/Listing paths/Running 'nvm which 0.0.2' should display only version 0.0.2

0
test/fast/Listing paths/Running "nvm which foo" should return a nonzero exit code when not found → test/fast/Listing paths/Running 'nvm which foo' should return a nonzero exit code when not found

0
test/fast/Listing versions/Running "nvm ls --no-alias" does not call into nvm_alias → test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias

0
test/fast/Listing versions/Running "nvm ls --no-alias" with a pattern errors → test/fast/Listing versions/Running 'nvm ls --no-alias' with a pattern errors

0
test/fast/Listing versions/Running "nvm ls 0.0.2" should display only version 0.0.2. → test/fast/Listing versions/Running 'nvm ls 0.0.2' should display only version 0.0.2

0
test/fast/Listing versions/Running "nvm ls 0.2" should display only 0.2.x versions. → test/fast/Listing versions/Running 'nvm ls 0.2' should display only 0.2.x versions

0
test/fast/Listing versions/Running "nvm ls foo" should return a nonzero exit code when not found → test/fast/Listing versions/Running 'nvm ls foo' should return a nonzero exit code when not found

0
test/fast/Listing versions/Running "nvm ls io" should return NA → test/fast/Listing versions/Running 'nvm ls io' should return NA

0
test/fast/Listing versions/Running "nvm ls node_" should return a nonzero exit code when not found → test/fast/Listing versions/Running 'nvm ls node_' should return a nonzero exit code when not found

0
test/fast/Listing versions/Running "nvm ls stable" and "nvm ls unstable" should return the appropriate implicit alias → test/fast/Listing versions/Running 'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias

0
test/fast/Listing versions/Running "nvm ls system" should include "system" when appropriate → test/fast/Listing versions/Running 'nvm ls system' should include 'system' when appropriate

0
test/fast/Listing versions/Running "nvm ls" calls into nvm_alias → test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias

0
test/fast/Listing versions/Running "nvm ls" should display all installed versions. → test/fast/Listing versions/Running 'nvm ls' should display all installed versions

0
test/fast/Listing versions/Running "nvm ls" should filter out ".nvm" → test/fast/Listing versions/Running 'nvm ls' should filter out '.nvm'

0
test/fast/Listing versions/Running "nvm ls" should filter out "versions" → test/fast/Listing versions/Running 'nvm ls' should filter out 'versions'

0
test/fast/Listing versions/Running "nvm ls" should include "system" when appropriate → test/fast/Listing versions/Running 'nvm ls' should include 'system' when appropriate

0
test/fast/Listing versions/Running "nvm ls" should list versions in the "versions" directory → test/fast/Listing versions/Running 'nvm ls' should list versions in the 'versions' directory

0
test/fast/Listing versions/Running "nvm ls" should not show a trailing slash → test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash

0
test/fast/Listing versions/Running "nvm ls" with node-like versioning vx.x.x should only list a matched version → test/fast/Listing versions/Running 'nvm ls' with node-like versioning vx.x.x should only list a matched version

0
test/fast/Listing versions/Running "nvm ls" with nounset should not fail. → test/fast/Listing versions/Running 'nvm ls' with nounset should not fail

0
test/fast/Running "nvm alias" should create a file in the alias directory. → test/fast/Running 'nvm alias' should create a file in the alias directory

0
test/fast/Running "nvm current" should display current nvm environment. → test/fast/Running 'nvm current' should display current nvm environment

0
test/fast/Running "nvm deactivate" should unset the nvm environment variables. → test/fast/Running 'nvm deactivate' should unset the nvm environment variables

0
test/fast/Running "nvm install" with "--reinstall-packages-from" requires a valid version → test/fast/Running 'nvm install' with '--reinstall-packages-from' requires a valid version

0
test/fast/Running "nvm install" with an invalid version fails nicely → test/fast/Running 'nvm install' with an invalid version fails nicely

0
test/fast/Running "nvm unalias" should remove the alias file. → test/fast/Running 'nvm unalias' should remove the alias file

0
test/fast/Running "nvm uninstall" should remove the appropriate directory. → test/fast/Running 'nvm uninstall' should remove the appropriate directory

0
test/fast/Running "nvm uninstall" with incorrect file permissions fails nicely → test/fast/Running 'nvm uninstall' with incorrect file permissions fails nicely

0
test/fast/Running "nvm unload" should unset all function and variables. → test/fast/Running 'nvm unload' should unset all function and variables

0
test/fast/Running "nvm use foo" where "foo" is circular aborts → test/fast/Running 'nvm use foo' where 'foo' is circular aborts

0
test/fast/Running "nvm use iojs" uses latest io.js version → test/fast/Running 'nvm use iojs' uses latest io.js version

0
test/fast/Running "nvm use system" should work as expected → test/fast/Running 'nvm use system' should work as expected

0
test/fast/Running "nvm use x" should create and change the "current" symlink → test/fast/Running 'nvm use x' should create and change the 'current' symlink

0
test/fast/Running "nvm use x" should not create the "current" symlink if $NVM_SYMLINK_CURRENT is false → test/fast/Running 'nvm use x' should not create the 'current' symlink if $NVM_SYMLINK_CURRENT is false

0
test/fast/Running "nvm use" should drop CR char automatically. → test/fast/Running 'nvm use' should drop CR char automatically

0
test/fast/Sourcing nvm.sh should make the nvm command available. → test/fast/Sourcing nvm.sh should make the nvm command available

0
test/slow/Running "nvm current" should display current nvm environment. → test/slow/Running 'nvm current' should display current nvm environment

0
test/slow/nvm exec/Preamble works and respects "silent" flag → test/slow/nvm exec/Preamble works and respects 'silent' flag

0
test/slow/nvm exec/Running "nvm exec --lts" should work → test/slow/nvm exec/Running 'nvm exec --lts' should work

0
test/slow/nvm exec/Running "nvm exec 0.x" should work → test/slow/nvm exec/Running 'nvm exec 0.x' should work

0
test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version → test/slow/nvm exec/Running 'nvm exec' should pick up .nvmrc version

0
test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out → test/slow/nvm reinstall-packages/Running 'nvm copy-packages $(nvm ls current)' should error out

0
test/slow/nvm run/Running "nvm run --harmony --version" should work → test/slow/nvm run/Running 'nvm run --harmony --version' should work

0
test/slow/nvm run/Running "nvm run --lts" should work → test/slow/nvm run/Running 'nvm run --lts' should work

0
test/slow/nvm run/Running "nvm run 0.x" should error out sensibly when 0.x is not installed → test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed

0
test/slow/nvm run/Running "nvm run 0.x" should work → test/slow/nvm run/Running 'nvm run 0.x' should work

0
test/slow/nvm run/Running "nvm run" should pick up .nvmrc version → test/slow/nvm run/Running 'nvm run' should pick up .nvmrc version

0
test/slow/nvm uninstall/Running "nvm uninstall 0.12.6" uninstalls v0.12.6 → test/slow/nvm uninstall/Running 'nvm uninstall 0.12.6' uninstalls v0.12.6

0
test/slow/nvm uninstall/Running "nvm uninstall" with incorrect file permissions fails nicely → test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely

0
test/slow/nvm use/Running "nvm use --lts" uses latest LTS version → test/slow/nvm use/Running 'nvm use --lts' uses latest LTS version

0
test/slow/nvm use/Running "nvm use --lts=foo" uses latest "foo" LTS version → test/slow/nvm use/Running 'nvm use --lts=foo' uses latest 'foo' LTS version

0
test/slow/nvm use/Running "nvm use iojs" uses latest io.js version → test/slow/nvm use/Running 'nvm use iojs' uses latest io.js version

0
test/slow/nvm use/Running "nvm use node --silent" doesn't print anything → test/slow/nvm use/Running 'nvm use node --silent' doesn't print anything

0
test/slow/nvm use/Running "nvm use node" uses latest stable node version → test/slow/nvm use/Running 'nvm use node' uses latest stable node version

0
test/slow/nvm use/Running "nvm use v1.0.0" uses iojs-v1.0.0 iojs version → test/slow/nvm use/Running 'nvm use v1.0.0' uses iojs-v1.0.0 iojs version

0
test/slow/nvm use/Running "nvm use" calls "nvm_die_on_prefix" → test/slow/nvm use/Running 'nvm use' calls 'nvm_die_on_prefix'

Loading…
Cancel
Save