Skip to content

Commit 8db30bc

Browse files
committed
Use snapshot generated by SNAPSHOTS=overwrite cargo test
1 parent e5e9f2f commit 8db30bc

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/testsuite/help.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Tests for cargo's help output.
22
33
use cargo_test_support::registry::Package;
4+
use cargo_test_support::str;
45
use cargo_test_support::{basic_manifest, cargo_exe, cargo_process, paths, process, project};
56
use std::fs;
67
use std::path::Path;
@@ -34,7 +35,10 @@ fn help_external_subcommand() {
3435
.publish();
3536
cargo_process("install cargo-fake-help").run();
3637
cargo_process("help fake-help")
37-
.with_stdout_data("fancy help output\n")
38+
.with_stdout_data(str![[r#"
39+
fancy help output
40+
41+
"#]])
3842
.run();
3943
}
4044

@@ -140,12 +144,17 @@ fn help_alias() {
140144
// The `empty-alias` returns an error.
141145
cargo_process("help empty-alias")
142146
.env("PATH", Path::new(""))
143-
.with_stderr_data("The subcommand 'empty-alias' wasn't recognized
147+
.with_status(101)
148+
.with_stderr_data(str![[r#"
149+
[ERROR] no such command: `empty-alias`
144150
145-
FIXME: #14076 This assertion isn't working, as this line should have caused a test failure but didn't.
146-
",
147-
)
148-
.run_expect_error();
151+
Did you mean `empty-alias`?
152+
153+
View all installed commands with `cargo --list`
154+
Find a package to install `empty-alias` with `cargo search cargo-empty-alias`
155+
156+
"#]])
157+
.run();
149158

150159
// Because `simple-alias` aliases a subcommand with no arguments, help shows the manpage.
151160
help_with_man_and_path("", "simple-alias", "build", Path::new(""));

0 commit comments

Comments
 (0)