Skip to content

Commit 67aad4f

Browse files
committed
test: migrate rustup to snapbox
1 parent 808b777 commit 67aad4f

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

tests/testsuite/rustup.rs

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! Tests for Cargo's behavior under Rustup.
22
3-
#![allow(deprecated)]
4-
53
use cargo_test_support::paths::{home, root, CargoPathExt};
6-
use cargo_test_support::{cargo_process, process, project};
4+
use cargo_test_support::{cargo_process, process, project, str};
75
use std::env;
86
use std::env::consts::EXE_EXTENSION;
97
use std::ffi::OsString;
@@ -164,13 +162,12 @@ fn typical_rustup() {
164162
.env("RUSTUP_TOOLCHAIN", "test-toolchain")
165163
.env("RUSTUP_HOME", &rustup_home)
166164
.env("PATH", &path)
167-
.with_stderr(
168-
"\
169-
[CHECKING] foo v0.0.1 [..]
165+
.with_stderr_data(str![[r#"
166+
[CHECKING] foo v0.0.1 ([ROOT]/foo)
170167
real rustc running
171-
[FINISHED] [..]
172-
",
173-
)
168+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
169+
170+
"#]])
174171
.run();
175172

176173
// Do a similar test, but with a toolchain link that does not have cargo
@@ -182,13 +179,12 @@ real rustc running
182179
.env("RUSTUP_TOOLCHAIN", "test-toolchain")
183180
.env("RUSTUP_HOME", &rustup_home)
184181
.env("PATH", &path)
185-
.with_stderr(
186-
"\
187-
[CHECKING] foo v0.0.1 [..]
182+
.with_stderr_data(str![[r#"
183+
[CHECKING] foo v0.0.1 ([ROOT]/foo)
188184
real rustc running
189-
[FINISHED] [..]
190-
",
191-
)
185+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
186+
187+
"#]])
192188
.run();
193189
}
194190

@@ -252,13 +248,12 @@ fn custom_calls_other_cargo() {
252248
// rustup proxies.
253249
.env("RUSTUP_TOOLCHAIN", "test-toolchain")
254250
.env("RUSTUP_HOME", &rustup_home)
255-
.with_stderr(
256-
"\
251+
.with_stderr_data(str![[r#"
257252
custom command running
258-
[CHECKING] foo [..]
253+
[CHECKING] foo v0.0.1 ([ROOT]/foo)
259254
custom toolchain rustc running
260-
[FINISHED] [..]
261-
",
262-
)
255+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
256+
257+
"#]])
263258
.run();
264259
}

0 commit comments

Comments
 (0)