|
1 | 1 | //! Tests for cargo's help output.
|
2 | 2 |
|
3 | 3 | use cargo_test_support::registry::Package;
|
| 4 | +use cargo_test_support::str; |
4 | 5 | use cargo_test_support::{basic_manifest, cargo_exe, cargo_process, paths, process, project};
|
5 | 6 | use std::fs;
|
6 | 7 | use std::path::Path;
|
@@ -34,7 +35,10 @@ fn help_external_subcommand() {
|
34 | 35 | .publish();
|
35 | 36 | cargo_process("install cargo-fake-help").run();
|
36 | 37 | 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 | +"#]]) |
38 | 42 | .run();
|
39 | 43 | }
|
40 | 44 |
|
@@ -140,12 +144,17 @@ fn help_alias() {
|
140 | 144 | // The `empty-alias` returns an error.
|
141 | 145 | cargo_process("help empty-alias")
|
142 | 146 | .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` |
144 | 150 |
|
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(); |
149 | 158 |
|
150 | 159 | // Because `simple-alias` aliases a subcommand with no arguments, help shows the manpage.
|
151 | 160 | help_with_man_and_path("", "simple-alias", "build", Path::new(""));
|
|
0 commit comments