From abde0154dc3c206d919368002e60591c598c3e5e Mon Sep 17 00:00:00 2001 From: ryenus Date: Sat, 29 Jun 2024 13:10:42 +0800 Subject: [PATCH] trim leading space in mock output due to eclint --- test/fast/Unit tests/nvm_print_versions | 96 ++++++++++++------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/test/fast/Unit tests/nvm_print_versions b/test/fast/Unit tests/nvm_print_versions index 9736b0ebe89..072af2446eb 100755 --- a/test/fast/Unit tests/nvm_print_versions +++ b/test/fast/Unit tests/nvm_print_versions @@ -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" @@ -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"