Skip to content

Commit 531b744

Browse files
rami3lChrisDenton
andcommitted
test(cli/rustup): test sad path about RUST_RECURSION_COUNT
Co-authored-by: Chris Denton <chris@chrisdenton.dev>
1 parent ba7844f commit 531b744

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎tests/suite/cli_rustup.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::{
77
};
88

99
use rustup::{
10+
env_var::RUST_RECURSION_COUNT_MAX,
1011
for_host,
1112
test::{
1213
CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_tuple,
@@ -710,6 +711,23 @@ async fn recursive_cargo() {
710711
711712
"#]])
712713
.is_ok();
714+
715+
// If we have set the current recursion count to the maximum while doing
716+
// another recursion, then rustup should bail out warning about it.
717+
cx.config
718+
.expect_with_env(
719+
["cargo", "--recursive-cargo-subcommand"],
720+
[(
721+
"RUST_RECURSION_COUNT",
722+
&*RUST_RECURSION_COUNT_MAX.to_string(),
723+
)],
724+
)
725+
.await
726+
.with_stderr(snapbox::str![[r#"
727+
error: infinite recursion detected
728+
...
729+
"#]])
730+
.is_err();
713731
}
714732

715733
#[tokio::test]

0 commit comments

Comments
 (0)