Skip to content

Commit

Permalink
trim leading space in mock output due to eclint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenus committed Jun 29, 2024
1 parent c15e2b1 commit abde015
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions test/fast/Unit tests/nvm_print_versions
Original file line number Diff line number Diff line change
Expand Up @@ -53,67 +53,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 @@ -125,12 +125,12 @@ system
"
}

OUTPUT="$(NVM_NO_COLORS=1 NVM_MIN_VER=20.1 nvm_print_versions "$(nvm_remote_versions)")"
EXPECTED_OUTPUT=" v16.20.2 * (Latest LTS: Gallium)
v20.8.1
v20.9.0 (Latest LTS: Iron)
v21.0.0
v21.1.0"
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"

[ "_$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 abde015

Please sign in to comment.