Skip to content

Commit 15ccde7

Browse files
committed
Test the up aliases exist via help text
This is cheaper than running them redundantly in the tests for 'rustup check'.
1 parent 74c154f commit 15ccde7

File tree

4 files changed

+59
-10
lines changed

4 files changed

+59
-10
lines changed

tests/cli-exact.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ fn check_updates_none() {
167167
expect_ok(config, &["rustup", "update", "stable"]);
168168
expect_ok(config, &["rustup", "update", "beta"]);
169169
expect_ok(config, &["rustup", "update", "nightly"]);
170-
expect_ok(config, &["rustup", "upgrade", "stable"]);
171-
expect_ok(config, &["rustup", "upgrade", "beta"]);
172-
expect_ok(config, &["rustup", "upgrade", "nightly"]);
173-
expect_ok(config, &["rustup", "up", "stable"]);
174-
expect_ok(config, &["rustup", "up", "beta"]);
175-
expect_ok(config, &["rustup", "up", "nightly"]);
176170
expect_stdout_ok(
177171
config,
178172
&["rustup", "check"],
@@ -193,9 +187,6 @@ fn check_updates_some() {
193187
expect_ok(config, &["rustup", "update", "stable"]);
194188
expect_ok(config, &["rustup", "update", "beta"]);
195189
expect_ok(config, &["rustup", "update", "nightly"]);
196-
expect_ok(config, &["rustup", "upgrade", "stable"]);
197-
expect_ok(config, &["rustup", "upgrade", "beta"]);
198-
expect_ok(config, &["rustup", "upgrade", "nightly"]);
199190
set_current_dist_date(config, "2015-01-02");
200191
expect_stdout_ok(
201192
config,

tests/cli-ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fs;
22

33
#[test]
4-
fn ui_tests() {
4+
fn ui_doc_text_tests() {
55
let t = trycmd::TestCases::new();
66
let rustup_init = trycmd::cargo::cargo_bin("rustup-init");
77
let rustup = trycmd::cargo::cargo_bin("rustup");
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
bin.name = "rustup"
2+
args = ["up","--help"]
3+
stdout = """
4+
...
5+
Update Rust toolchains and rustup
6+
7+
USAGE:
8+
rustup[EXE] update [FLAGS] [toolchain]...
9+
10+
FLAGS:
11+
--force Force an update, even if some components are missing
12+
--force-non-host Install toolchains that require an emulator. See https://github.com/rust-
13+
lang/rustup/wiki/Non-host-toolchains
14+
-h, --help Prints help information
15+
--no-self-update Don't perform self update when running the `rustup update` command
16+
17+
ARGS:
18+
<toolchain>... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help
19+
toolchain`
20+
21+
DISCUSSION:
22+
With no toolchain specified, the `update` command updates each of
23+
the installed toolchains from the official release channels, then
24+
updates rustup itself.
25+
26+
If given a toolchain argument then `update` updates that
27+
toolchain, the same as `rustup toolchain install`.
28+
"""
29+
stderr = ""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
bin.name = "rustup"
2+
args = ["upgrade","--help"]
3+
stdout = """
4+
...
5+
Update Rust toolchains and rustup
6+
7+
USAGE:
8+
rustup[EXE] update [FLAGS] [toolchain]...
9+
10+
FLAGS:
11+
--force Force an update, even if some components are missing
12+
--force-non-host Install toolchains that require an emulator. See https://github.com/rust-
13+
lang/rustup/wiki/Non-host-toolchains
14+
-h, --help Prints help information
15+
--no-self-update Don't perform self update when running the `rustup update` command
16+
17+
ARGS:
18+
<toolchain>... Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more information see `rustup help
19+
toolchain`
20+
21+
DISCUSSION:
22+
With no toolchain specified, the `update` command updates each of
23+
the installed toolchains from the official release channels, then
24+
updates rustup itself.
25+
26+
If given a toolchain argument then `update` updates that
27+
toolchain, the same as `rustup toolchain install`.
28+
"""
29+
stderr = ""

0 commit comments

Comments
 (0)