From c14d4d8dcc0f13aa0ae5c97e06b117c4c658cc34 Mon Sep 17 00:00:00 2001 From: ryenus Date: Sat, 29 Jun 2024 13:17:25 +0800 Subject: [PATCH] grim leading space in mock output due to eclint errors --- test/fast/Unit tests/nvm_print_versions | 94 ++++++++++++------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/test/fast/Unit tests/nvm_print_versions b/test/fast/Unit tests/nvm_print_versions index 124c9305a6f..dc12d554153 100755 --- a/test/fast/Unit tests/nvm_print_versions +++ b/test/fast/Unit tests/nvm_print_versions @@ -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" @@ -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"