From 8db30bc4bdd67de9947f1f9a5dd653edcc2c8d59 Mon Sep 17 00:00:00 2001 From: Lawrence Chou Date: Sat, 15 Jun 2024 22:43:11 +0800 Subject: [PATCH] Use snapshot generated by `SNAPSHOTS=overwrite cargo test` --- tests/testsuite/help.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/help.rs b/tests/testsuite/help.rs index e3ee00963fa..801de16a586 100644 --- a/tests/testsuite/help.rs +++ b/tests/testsuite/help.rs @@ -1,6 +1,7 @@ //! Tests for cargo's help output. use cargo_test_support::registry::Package; +use cargo_test_support::str; use cargo_test_support::{basic_manifest, cargo_exe, cargo_process, paths, process, project}; use std::fs; use std::path::Path; @@ -34,7 +35,10 @@ fn help_external_subcommand() { .publish(); cargo_process("install cargo-fake-help").run(); cargo_process("help fake-help") - .with_stdout_data("fancy help output\n") + .with_stdout_data(str![[r#" +fancy help output + +"#]]) .run(); } @@ -140,12 +144,17 @@ fn help_alias() { // The `empty-alias` returns an error. cargo_process("help empty-alias") .env("PATH", Path::new("")) - .with_stderr_data("The subcommand 'empty-alias' wasn't recognized + .with_status(101) + .with_stderr_data(str![[r#" +[ERROR] no such command: `empty-alias` -FIXME: #14076 This assertion isn't working, as this line should have caused a test failure but didn't. - ", - ) - .run_expect_error(); + Did you mean `empty-alias`? + + View all installed commands with `cargo --list` + Find a package to install `empty-alias` with `cargo search cargo-empty-alias` + +"#]]) + .run(); // Because `simple-alias` aliases a subcommand with no arguments, help shows the manpage. help_with_man_and_path("", "simple-alias", "build", Path::new(""));