From 5e2e0337b10e639de78ad036f5afd73ad2198e1d Mon Sep 17 00:00:00 2001 From: JoshuaBatty Date: Tue, 18 Jun 2024 15:59:52 +1000 Subject: [PATCH] fix test --- tests/default.rs | 11 +++++++---- tests/show.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/default.rs b/tests/default.rs index c45488d1e..109f7086a 100644 --- a/tests/default.rs +++ b/tests/default.rs @@ -54,12 +54,15 @@ fn fuelup_default_latest_and_custom() -> Result<()> { #[test] fn fuelup_default_uninstalled_toolchain() -> Result<()> { testcfg::setup(FuelupState::LatestToolchainInstalled, &|cfg| { + let triple = TargetTriple::from_host().unwrap(); let output = cfg.fuelup(&["default", "nightly"]); let expected_stdout = format!( - "Toolchain with name 'nightly-{}' does not exist\n", - TargetTriple::from_host().unwrap() + "Toolchain with name 'nightly-{}' does not exist\n\n\ + \u{1b}[1mInstalled toolchains\u{1b}[0m\n\ + --------------------\n\ + latest-{}\n\n", + triple, triple ); - assert_eq!(output.stdout, expected_stdout); })?; @@ -128,7 +131,7 @@ fn fuelup_default_missing_toolchain() -> Result<()> { let output = cfg.fuelup(&["default", "abcd"]); let expected_stdout = format!( "Toolchain with name 'abcd' does not exist\n\n\ - \u{1b}[1minstalled toolchains\u{1b}[0m\n\ + \u{1b}[1mInstalled toolchains\u{1b}[0m\n\ --------------------\n\ latest-{triple}\n\ nightly-{triple}\n\ diff --git a/tests/show.rs b/tests/show.rs index d39fd3528..3f409e8ca 100644 --- a/tests/show.rs +++ b/tests/show.rs @@ -22,7 +22,7 @@ fn fuelup_show_latest() -> Result<()> { r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} (default) nightly-{target} @@ -66,7 +66,7 @@ fn fuelup_show_and_switch() -> Result<()> { r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} (default) nightly-{target} @@ -102,7 +102,7 @@ latest-{target} (default) r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} nightly-{target} (default) @@ -146,7 +146,7 @@ fn fuelup_show_custom() -> Result<()> { r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- my_toolchain (default) @@ -187,7 +187,7 @@ fn fuelup_show_override() -> Result<()> { r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} (default) @@ -229,7 +229,7 @@ fn fuelup_show_latest_then_override() -> Result<()> { r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} (default) nightly-{target} @@ -278,7 +278,7 @@ latest-{target} (default) r#"Default host: {target} fuelup home: {fuelup_home_str} -installed toolchains +Installed toolchains -------------------- latest-{target} (default) nightly-{target}