Skip to content

Commit 2f72d0f

Browse files
FranciscoTGouveiarami3l
authored andcommitted
test(custom-toolchains): target list now can display the installed targets
Since we can now list the available targets for a custom toolchain, this test needed to be updated. This is consistent with the new migration to the `.expect()` API's that were showcased in #4343.
1 parent 1a318b1 commit 2f72d0f

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

tests/suite/cli_v2.rs

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -836,21 +836,42 @@ async fn list_targets_v1_toolchain() {
836836

837837
#[tokio::test]
838838
async fn list_targets_custom_toolchain() {
839-
let mut cx = CliTestContext::new(Scenario::SimpleV2).await;
840-
let path = cx.config.customdir.join("custom-1");
841-
let path = path.to_string_lossy();
839+
let cx = CliTestContext::new(Scenario::SimpleV2).await;
842840
cx.config
843-
.expect_ok(&["rustup", "toolchain", "link", "default-from-path", &path])
844-
.await;
841+
.expect(&["rustup", "default", "stable"])
842+
.await
843+
.is_ok();
844+
let stable_path = cx
845+
.config
846+
.rustupdir
847+
.join("toolchains")
848+
.join(format!("stable-{}", this_host_triple()));
845849
cx.config
846-
.expect_ok(&["rustup", "default", "default-from-path"])
847-
.await;
850+
.expect([
851+
"rustup",
852+
"toolchain",
853+
"link",
854+
"stuff",
855+
&stable_path.to_string_lossy(),
856+
])
857+
.await
858+
.is_ok();
848859
cx.config
849-
.expect_err(
850-
&["rustup", "target", "list"],
851-
"toolchain 'default-from-path' does not support components",
852-
)
853-
.await;
860+
.expect(["rustup", "+stuff", "target", "list", "--installed"])
861+
.await
862+
.with_stdout(snapbox::str![[r#"
863+
[HOST_TRIPLE]
864+
865+
"#]])
866+
.is_ok();
867+
cx.config
868+
.expect(["rustup", "+stuff", "target", "list"])
869+
.await
870+
.with_stdout(snapbox::str![[r#"
871+
[HOST_TRIPLE] (installed)
872+
873+
"#]])
874+
.is_ok();
854875
}
855876

856877
#[tokio::test]

0 commit comments

Comments
 (0)