Skip to content

Commit

Permalink
grim leading space in mock output due to eclint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenus committed Jun 29, 2024
1 parent 59e190d commit c14d4d8
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions test/fast/Unit tests/nvm_print_versions
Original file line number Diff line number Diff line change
Expand Up @@ -51,67 +51,67 @@ v21.1.0"


# nvm_print_versions should print all versions from nvm_remote_versions
OUTPUT="$(NVM_NO_COLORS=1 nvm_print_versions "$(nvm_remote_versions)")"
EXPECTED_OUTPUT=" v16.0.0
v16.20.2 * (Latest LTS: Gallium)
v17.0.0
v17.9.1
v18.0.0
v18.1.0
v18.20.2 (LTS: Hydrogen)
OUTPUT="$(NVM_NO_COLORS=1 nvm_print_versions "$(nvm_remote_versions)" | sed -r 's/^[ \t]+//')"
EXPECTED_OUTPUT="v16.0.0
v16.20.2 * (Latest LTS: Gallium)
v17.0.0
v17.9.1
v18.0.0
v18.1.0
v18.20.2 (LTS: Hydrogen)
-> v18.20.3 * (Latest LTS: Hydrogen)
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"

[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_print_versions did not output all expected versions; got $OUTPUT"


# versions lower than 18 should be filtered out, but v16.20.2 should be kept since it's installed
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=18 nvm_print_versions "$(nvm_remote_versions)")"
EXPECTED_OUTPUT=" v16.20.2 * (Latest LTS: Gallium)
v18.0.0
v18.1.0
v18.20.2 (LTS: Hydrogen)
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=18 nvm_print_versions "$(nvm_remote_versions)" | sed -r 's/^[ \t]+//')"
EXPECTED_OUTPUT="v16.20.2 * (Latest LTS: Gallium)
v18.0.0
v18.1.0
v18.20.2 (LTS: Hydrogen)
-> v18.20.3 * (Latest LTS: Hydrogen)
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"

[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_MIN_VER=18 nvm_print_versions did not output all expected versions; got $OUTPUT"


# versions lower than 19 should be filtered out
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=19 nvm_print_versions "$(nvm_remote_versions)")"
EXPECTED_OUTPUT=" v16.20.2 * (Latest LTS: Gallium)
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=19 nvm_print_versions "$(nvm_remote_versions)" | sed -r 's/^[ \t]+//')"
EXPECTED_OUTPUT="v16.20.2 * (Latest LTS: Gallium)
-> v18.20.3 * (Latest LTS: Hydrogen)
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
v19.0.0
v19.9.0
v20.0.0
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"

[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_MIN_VER=19 nvm_print_versions did not output all expected versions; got $OUTPUT"


# versions lower than 20.1 should be filtered out, so v20.0.0 is out
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=20.1 nvm_print_versions "$(nvm_remote_versions)")"
EXPECTED_OUTPUT=" v16.20.2 * (Latest LTS: Gallium)
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=20.1 nvm_print_versions "$(nvm_remote_versions)" | sed -r 's/^[ \t]+//')"
EXPECTED_OUTPUT="v16.20.2 * (Latest LTS: Gallium)
-> v18.20.3 * (Latest LTS: Hydrogen)
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"

[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_MIN_VER=20.1 nvm_print_versions did not output all expected versions; got $OUTPUT"

Expand All @@ -126,12 +126,12 @@ nvm_ls_current() {
echo "v16.20.2"
}

OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=20.1 nvm_print_versions "$(nvm_remote_versions)")"
OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=20.1 nvm_print_versions "$(nvm_remote_versions)" | sed -r 's/^[ \t]+//')"
EXPECTED_OUTPUT="-> v16.20.2 * (Latest LTS: Gallium)
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"

[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_MIN_VER=20.1 nvm_print_versions did not output all expected versions; got $OUTPUT"

Expand Down

0 comments on commit c14d4d8

Please sign in to comment.