Skip to content

Commit 4e8bcf5

Browse files
committed
Make it clearer what each Scenario enables
1 parent bca2352 commit 4e8bcf5

8 files changed

+314
-305
lines changed

tests/cli-exact.rs

+23-23
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ fn update() {
2626
&["rustup", "update", "nightly", "--no-self-update"],
2727
for_host!(
2828
r"
29-
nightly-{0} installed - 1.3.0 (hash-n-2)
29+
nightly-{0} installed - 1.3.0 (hash-nightly-2)
3030
3131
"
3232
),
3333
for_host!(
3434
r"info: syncing channel updates for 'nightly-{0}'
35-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
35+
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
3636
info: downloading component 'rustc'
3737
info: downloading component 'cargo'
3838
info: downloading component 'rust-std'
@@ -57,7 +57,7 @@ fn update_again() {
5757
&["rustup", "update", "nightly", "--no-self-update"],
5858
for_host!(
5959
r"
60-
nightly-{0} unchanged - 1.3.0 (hash-n-2)
60+
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)
6161
6262
"
6363
),
@@ -80,9 +80,9 @@ fn check_updates_none() {
8080
config,
8181
&["rustup", "check"],
8282
for_host!(
83-
r"stable-{0} - Up to date : 1.0.0 (hash-s-1)
84-
beta-{0} - Up to date : 1.1.0 (hash-b-1)
85-
nightly-{0} - Up to date : 1.2.0 (hash-n-1)
83+
r"stable-{0} - Up to date : 1.0.0 (hash-stable-1.0.0)
84+
beta-{0} - Up to date : 1.1.0 (hash-beta-1.1.0)
85+
nightly-{0} - Up to date : 1.2.0 (hash-nightly-1)
8686
"
8787
),
8888
);
@@ -101,9 +101,9 @@ fn check_updates_some() {
101101
config,
102102
&["rustup", "check"],
103103
for_host!(
104-
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
105-
beta-{0} - Update available : 1.1.0 (hash-b-1) -> 1.2.0 (hash-b-2)
106-
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
104+
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
105+
beta-{0} - Update available : 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0)
106+
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
107107
"
108108
),
109109
);
@@ -121,9 +121,9 @@ fn check_updates_with_update() {
121121
config,
122122
&["rustup", "check"],
123123
for_host!(
124-
r"stable-{0} - Up to date : 1.0.0 (hash-s-1)
125-
beta-{0} - Up to date : 1.1.0 (hash-b-1)
126-
nightly-{0} - Up to date : 1.2.0 (hash-n-1)
124+
r"stable-{0} - Up to date : 1.0.0 (hash-stable-1.0.0)
125+
beta-{0} - Up to date : 1.1.0 (hash-beta-1.1.0)
126+
nightly-{0} - Up to date : 1.2.0 (hash-nightly-1)
127127
"
128128
),
129129
);
@@ -132,9 +132,9 @@ nightly-{0} - Up to date : 1.2.0 (hash-n-1)
132132
config,
133133
&["rustup", "check"],
134134
for_host!(
135-
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
136-
beta-{0} - Update available : 1.1.0 (hash-b-1) -> 1.2.0 (hash-b-2)
137-
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
135+
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
136+
beta-{0} - Update available : 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0)
137+
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
138138
"
139139
),
140140
);
@@ -143,9 +143,9 @@ nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
143143
config,
144144
&["rustup", "check"],
145145
for_host!(
146-
r"stable-{0} - Update available : 1.0.0 (hash-s-1) -> 1.1.0 (hash-s-2)
147-
beta-{0} - Up to date : 1.2.0 (hash-b-2)
148-
nightly-{0} - Update available : 1.2.0 (hash-n-1) -> 1.3.0 (hash-n-2)
146+
r"stable-{0} - Update available : 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0)
147+
beta-{0} - Up to date : 1.2.0 (hash-beta-1.2.0)
148+
nightly-{0} - Update available : 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2)
149149
"
150150
),
151151
);
@@ -160,13 +160,13 @@ fn default() {
160160
&["rustup", "default", "nightly"],
161161
for_host!(
162162
r"
163-
nightly-{0} installed - 1.3.0 (hash-n-2)
163+
nightly-{0} installed - 1.3.0 (hash-nightly-2)
164164
165165
"
166166
),
167167
for_host!(
168168
r"info: syncing channel updates for 'nightly-{0}'
169-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
169+
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
170170
info: downloading component 'rustc'
171171
info: downloading component 'cargo'
172172
info: downloading component 'rust-std'
@@ -192,7 +192,7 @@ fn override_again() {
192192
&["rustup", "override", "add", "nightly"],
193193
for_host!(
194194
r"
195-
nightly-{} unchanged - 1.3.0 (hash-n-2)
195+
nightly-{} unchanged - 1.3.0 (hash-nightly-2)
196196
197197
"
198198
),
@@ -426,7 +426,7 @@ fn update_invalid_toolchain() {
426426
&["rustup", "update", "nightly-2016-03-1"],
427427
r"",
428428
r"info: syncing channel updates for 'nightly-2016-03-1'
429-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
429+
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
430430
error: target '2016-03-1' not found in channel. Perhaps check https://forge.rust-lang.org/platform-support.html for available targets
431431
",
432432
);
@@ -441,7 +441,7 @@ fn default_invalid_toolchain() {
441441
&["rustup", "default", "nightly-2016-03-1"],
442442
r"",
443443
r"info: syncing channel updates for 'nightly-2016-03-1'
444-
info: latest update on 2015-01-02, rust version 1.3.0 (hash-n-2)
444+
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
445445
error: target '2016-03-1' not found in channel. Perhaps check https://forge.rust-lang.org/platform-support.html for available targets
446446
",
447447
);

tests/cli-inst-interactive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn blank_lines_around_stderr_log_output_install() {
8484
3) Cancel installation
8585
>
8686
87-
stable installed - 1.1.0 (hash-s-2)
87+
stable installed - 1.1.0 (hash-stable-1.1.0)
8888
8989
9090
Rust is installed now. Great!

tests/cli-misc.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn update_all_no_update_whitespace() {
100100
&["rustup", "update", "nightly", "--no-self-update"],
101101
for_host!(
102102
r"
103-
nightly-{} installed - 1.3.0 (hash-n-2)
103+
nightly-{} installed - 1.3.0 (hash-nightly-2)
104104
105105
"
106106
),
@@ -197,7 +197,7 @@ fn multi_host_smoke_test() {
197197
clitools::setup(Scenario::MultiHost, &|config| {
198198
let toolchain = format!("nightly-{}", clitools::MULTI_ARCH1);
199199
expect_ok(config, &["rustup", "default", &toolchain]);
200-
expect_stdout_ok(config, &["rustc", "--version"], "xxxx-n-2"); // cross-host mocks have their own versions
200+
expect_stdout_ok(config, &["rustc", "--version"], "xxxx-nightly-2"); // cross-host mocks have their own versions
201201
});
202202
}
203203

@@ -219,13 +219,13 @@ fn custom_toolchain_cargo_fallback_proxy() {
219219
expect_ok(config, &["rustup", "default", "mytoolchain"]);
220220

221221
expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
222-
expect_stdout_ok(config, &["cargo", "--version"], "hash-s-2");
222+
expect_stdout_ok(config, &["cargo", "--version"], "hash-stable-1.1.0");
223223

224224
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
225-
expect_stdout_ok(config, &["cargo", "--version"], "hash-b-2");
225+
expect_stdout_ok(config, &["cargo", "--version"], "hash-beta-1.2.0");
226226

227227
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
228-
expect_stdout_ok(config, &["cargo", "--version"], "hash-n-2");
228+
expect_stdout_ok(config, &["cargo", "--version"], "hash-nightly-2");
229229
});
230230
}
231231

@@ -250,21 +250,21 @@ fn custom_toolchain_cargo_fallback_run() {
250250
expect_stdout_ok(
251251
config,
252252
&["rustup", "run", "mytoolchain", "cargo", "--version"],
253-
"hash-s-2",
253+
"hash-stable-1.1.0",
254254
);
255255

256256
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
257257
expect_stdout_ok(
258258
config,
259259
&["rustup", "run", "mytoolchain", "cargo", "--version"],
260-
"hash-b-2",
260+
"hash-beta-1.2.0",
261261
);
262262

263263
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
264264
expect_stdout_ok(
265265
config,
266266
&["rustup", "run", "mytoolchain", "cargo", "--version"],
267-
"hash-n-2",
267+
"hash-nightly-2",
268268
);
269269
});
270270
}
@@ -738,13 +738,13 @@ fn update_unavailable_rustc() {
738738
set_current_dist_date(config, "2015-01-01");
739739
expect_ok(config, &["rustup", "default", "nightly"]);
740740

741-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
741+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
742742

743743
// latest nightly is unavailable
744744
set_current_dist_date(config, "2015-01-02");
745745
// update should do nothing
746746
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
747-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
747+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
748748
});
749749
}
750750

@@ -754,7 +754,7 @@ fn update_nightly_even_with_incompat() {
754754
set_current_dist_date(config, "2019-09-12");
755755
expect_ok(config, &["rustup", "default", "nightly"]);
756756

757-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
757+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
758758
expect_ok(config, &["rustup", "component", "add", "rls"]);
759759
expect_component_executable(config, "rls");
760760

@@ -764,7 +764,7 @@ fn update_nightly_even_with_incompat() {
764764
expect_component_executable(config, "rls");
765765
// update should bring us to latest nightly that does
766766
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
767-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-2");
767+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-2");
768768
expect_component_executable(config, "rls");
769769
});
770770
}
@@ -775,14 +775,14 @@ fn nightly_backtrack_skips_missing() {
775775
set_current_dist_date(config, "2015-01-01");
776776
expect_ok(config, &["rustup", "default", "nightly"]);
777777

778-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
778+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
779779

780780
// nightly is missing on latest
781781
set_current_dist_date(config, "2015-01-02");
782782

783783
// update should not change nightly, and should not error
784784
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
785-
expect_stdout_ok(config, &["rustc", "--version"], "hash-n-1");
785+
expect_stdout_ok(config, &["rustc", "--version"], "hash-nightly-1");
786786
});
787787
}
788788

0 commit comments

Comments
 (0)