Skip to content

Commit 6231595

Browse files
committed
FIXME: show stack overflow
1 parent 4b961f6 commit 6231595

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/suite/cli_exact.rs

+30
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustup::for_host;
55
use rustup::test::{
66
CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_triple,
77
};
8+
use rustup::utils::raw;
89

910
#[tokio::test]
1011
async fn update_once() {
@@ -699,6 +700,35 @@ help: run `rustup toolchain install nightly-{0}` to install it
699700
.await;
700701
}
701702

703+
// issue #4212
704+
#[tokio::test]
705+
async fn show_suggestion_for_missing_toolchain_with_components() {
706+
let cx = CliTestContext::new(Scenario::SimpleV2).await;
707+
708+
let cwd = cx.config.current_dir();
709+
let toolchain_file = cwd.join("rust-toolchain.toml");
710+
raw::write_file(
711+
&toolchain_file,
712+
r#"
713+
[toolchain]
714+
channel = "stable"
715+
components = [ "rust-src" ]
716+
"#,
717+
)
718+
.unwrap();
719+
cx.config
720+
.expect_err_env(
721+
&["cargo", "fmt"],
722+
&[("RUSTUP_AUTO_INSTALL", "0")],
723+
for_host!(
724+
r"error: toolchain 'nightly-{0}' is not installed
725+
help: run `rustup toolchain install` to install it
726+
"
727+
),
728+
)
729+
.await;
730+
}
731+
702732
// issue #927
703733
#[tokio::test]
704734
async fn undefined_linked_toolchain() {

0 commit comments

Comments
 (0)