Skip to content

Commit 3b1d84e

Browse files
committed
chore(test): deprecated old APIs overlapping with the new ones
1 parent 083be93 commit 3b1d84e

9 files changed

+25
-0
lines changed

src/test/clitools.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,14 @@ impl Config {
230230
}
231231

232232
/// Expect an ok status
233+
#[deprecated(note = "use `.expect().await.is_ok()` instead")]
234+
#[allow(deprecated)]
233235
pub async fn expect_ok(&mut self, args: &[&str]) {
234236
self.expect_ok_env(args, &[]).await
235237
}
236238

237239
/// Expect an ok status with extra environment variables
240+
#[deprecated(note = "use `.expect_with_env().await.is_ok()` instead")]
238241
pub async fn expect_ok_env(&self, args: &[&str], env: &[(&str, &str)]) {
239242
let out = self.run(args[0], &args[1..], env).await;
240243
if !out.ok {
@@ -245,11 +248,14 @@ impl Config {
245248
}
246249

247250
/// Expect an err status and a string in stderr
251+
#[deprecated(note = "use `.expect().await.is_err()` instead")]
252+
#[allow(deprecated)]
248253
pub async fn expect_err(&self, args: &[&str], expected: &str) {
249254
self.expect_err_env(args, &[], expected).await
250255
}
251256

252257
/// Expect an err status and a string in stderr, with extra environment variables
258+
#[deprecated(note = "use `.expect_with_env().await.is_err()` instead")]
253259
pub async fn expect_err_env(&self, args: &[&str], env: &[(&str, &str)], expected: &str) {
254260
let out = self.run(args[0], &args[1..], env).await;
255261
if out.ok || !out.stderr.contains(expected) {
@@ -261,6 +267,7 @@ impl Config {
261267
}
262268

263269
/// Expect an ok status and a string in stdout
270+
#[deprecated(note = "use `.expect().await.is_ok().with_stdout()` instead")]
264271
pub async fn expect_stdout_ok(&self, args: &[&str], expected: &str) {
265272
let out = self.run(args[0], &args[1..], &[]).await;
266273
if !out.ok || !out.stdout.contains(expected) {
@@ -271,6 +278,7 @@ impl Config {
271278
}
272279
}
273280

281+
#[deprecated(note = "use `.expect().await.is_ok().without_stdout()` instead")]
274282
pub async fn expect_not_stdout_ok(&self, args: &[&str], expected: &str) {
275283
let out = self.run(args[0], &args[1..], &[]).await;
276284
if !out.ok || out.stdout.contains(expected) {
@@ -281,6 +289,7 @@ impl Config {
281289
}
282290
}
283291

292+
#[deprecated(note = "use `.expect().await.is_ok().without_stderr()` instead")]
284293
pub async fn expect_not_stderr_ok(&self, args: &[&str], expected: &str) {
285294
let out = self.run(args[0], &args[1..], &[]).await;
286295
if !out.ok || out.stderr.contains(expected) {
@@ -291,6 +300,7 @@ impl Config {
291300
}
292301
}
293302

303+
#[deprecated(note = "use `.expect().await.is_err().without_stderr()` instead")]
294304
pub async fn expect_not_stderr_err(&self, args: &[&str], expected: &str) {
295305
let out = self.run(args[0], &args[1..], &[]).await;
296306
if out.ok || out.stderr.contains(expected) {
@@ -302,6 +312,7 @@ impl Config {
302312
}
303313

304314
/// Expect an ok status and a string in stderr
315+
#[deprecated(note = "use `.expect().await.is_ok().with_stderr()` instead")]
305316
pub async fn expect_stderr_ok(&self, args: &[&str], expected: &str) {
306317
let out = self.run(args[0], &args[1..], &[]).await;
307318
if !out.ok || !out.stderr.contains(expected) {
@@ -313,12 +324,17 @@ impl Config {
313324
}
314325

315326
/// Expect an exact strings on stdout/stderr with an ok status code
327+
#[deprecated(note = "use `.expect().await.is_ok().with_stderr()` instead")]
328+
#[allow(deprecated)]
316329
pub async fn expect_ok_ex(&mut self, args: &[&str], stdout: &str, stderr: &str) {
317330
self.expect_ok_ex_env(args, &[], stdout, stderr).await;
318331
}
319332

320333
/// Expect an exact strings on stdout/stderr with an ok status code,
321334
/// with extra environment variables
335+
#[deprecated(
336+
note = "use `.expect_with_env().await.is_ok().with_stdout().with_stderr()` instead"
337+
)]
322338
pub async fn expect_ok_ex_env(
323339
&mut self,
324340
args: &[&str],
@@ -339,6 +355,7 @@ impl Config {
339355
}
340356

341357
/// Expect an exact strings on stdout/stderr with an error status code
358+
#[deprecated(note = "use `.expect().await.is_err().with_stdout().with_stderr()` instead")]
342359
pub async fn expect_err_ex(&self, args: &[&str], stdout: &str, stderr: &str) {
343360
let out = self.run(args[0], &args[1..], &[]).await;
344361
if out.ok || out.stdout != stdout || out.stderr != stderr {

tests/suite/cli_exact.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Yet more cli test cases. These are testing that the output
23
//! is exactly as expected.
34

tests/suite/cli_inst_interactive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Tests of the interactive console installer
23
34
use std::env::consts::EXE_SUFFIX;

tests/suite/cli_misc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Test cases of the rustup command that do not depend on the
23
//! dist server, mostly derived from multirust/test-v2.sh
34

tests/suite/cli_paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! This file contains tests relevant to Rustup's handling of updating PATHs.
23
//! It depends on self-update working, so if absolutely everything here breaks,
34
//! check those tests as well.

tests/suite/cli_rustup.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Test cases for new rustup UI
23
34
use std::fs;

tests/suite/cli_self_upd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Testing self install, uninstall and update
23
34
use std::env;

tests/suite/cli_v1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Test cases of the rustup command, using v1 manifests, mostly
23
//! derived from multirust/test-v2.sh
34

tests/suite/cli_v2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)]
12
//! Test cases of the rustup command, using v2 manifests, mostly
23
//! derived from multirust/test-v2.sh
34

0 commit comments

Comments
 (0)