Skip to content

Commit e673802

Browse files
committed
test: update message snapshots to align with new error message
1 parent 35a595f commit e673802

File tree

8 files changed

+50
-41
lines changed

8 files changed

+50
-41
lines changed

tests/testsuite/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6043,7 +6043,7 @@ fn avoid_dev_deps() {
60436043
.with_stderr_data(str![[r#"
60446044
[UPDATING] `dummy-registry` index
60456045
[ERROR] no matching package named `baz` found
6046-
location searched: registry `crates-io`
6046+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
60476047
required by package `bar v0.1.0 ([ROOT]/foo)`
60486048
60496049
"#]])

tests/testsuite/directory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Caused by:
199199
no matching package found
200200
searched package name: `baz`
201201
perhaps you meant: bar or foo
202-
location searched: registry `crates-io`
202+
location searched: directory source `[ROOT]/index` (which is replacing registry `crates-io`)
203203
required by package `bar v0.1.0`
204204
205205
"#]])
@@ -283,7 +283,7 @@ fn not_there() {
283283
.with_status(101)
284284
.with_stderr_data(str![[r#"
285285
[ERROR] no matching package named `bar` found
286-
location searched: registry `crates-io`
286+
location searched: directory source `[ROOT]/index` (which is replacing registry `crates-io`)
287287
required by package `foo v0.1.0 ([ROOT]/foo)`
288288
289289
"#]])

tests/testsuite/local_registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn not_found() {
101101
.with_status(101)
102102
.with_stderr_data(str![[r#"
103103
[ERROR] no matching package named `baz` found
104-
location searched: registry `crates-io`
104+
location searched: `[ROOT]/registry` index (which is replacing registry `crates-io`)
105105
required by package `foo v0.0.1 ([ROOT]/foo)`
106106
107107
"#]])

tests/testsuite/offline.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn cargo_compile_offline_not_try_update() {
184184
.with_status(101)
185185
.with_stderr_data(str![[r#"
186186
[ERROR] no matching package named `not_cached_dep` found
187-
location searched: registry `crates-io`
187+
location searched: crates.io index
188188
required by package `bar v0.1.0 ([ROOT]/bar)`
189189
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
190190
@@ -195,7 +195,7 @@ As a reminder, you're using offline mode (--offline) which can sometimes cause s
195195
p.change_file(".cargo/config.toml", "net.offline = true");
196196
p.cargo("check").with_status(101).with_stderr_data(str![[r#"
197197
[ERROR] no matching package named `not_cached_dep` found
198-
location searched: registry `crates-io`
198+
location searched: crates.io index
199199
required by package `bar v0.1.0 ([ROOT]/bar)`
200200
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
201201
@@ -366,7 +366,7 @@ Caused by:
366366
.run();
367367
}
368368

369-
fn update_offline_not_cached() {
369+
fn update_offline_not_cached(is_registry_set: bool) {
370370
let p = project()
371371
.file(
372372
"Cargo.toml",
@@ -383,30 +383,39 @@ fn update_offline_not_cached() {
383383
)
384384
.file("src/main.rs", "fn main() {}")
385385
.build();
386+
387+
let location_searched_message;
388+
if is_registry_set {
389+
location_searched_message =
390+
"`dummy-registry` index (which is replacing registry `crates-io`)";
391+
} else {
392+
location_searched_message = "crates.io index"
393+
}
394+
386395
p.cargo("update --offline")
387396
.with_status(101)
388-
.with_stderr_data(
397+
.with_stderr_data(&format!(
389398
"\
390399
[ERROR] no matching package named `bar` found
391-
location searched: registry `crates-io`
400+
location searched: {location_searched_message}
392401
required by package `foo v0.0.1 ([ROOT]/foo)`
393402
As a reminder, you're using offline mode (--offline) which can sometimes cause \
394403
surprising resolution failures, if this error is too confusing you may wish to \
395404
retry without the offline flag.
396-
",
397-
)
405+
"
406+
))
398407
.run();
399408
}
400409

401410
#[cargo_test]
402411
fn update_offline_not_cached_sparse() {
403412
let _registry = RegistryBuilder::new().http_index().build();
404-
update_offline_not_cached()
413+
update_offline_not_cached(true)
405414
}
406415

407416
#[cargo_test]
408417
fn update_offline_not_cached_git() {
409-
update_offline_not_cached()
418+
update_offline_not_cached(false)
410419
}
411420

412421
#[cargo_test]
@@ -756,7 +765,7 @@ fn main(){
756765
.with_stderr_data(
757766
str![[r#"
758767
[ERROR] no matching package named `present_dep` found
759-
location searched: registry `crates-io`
768+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
760769
required by package `foo v0.1.0 ([ROOT]/foo)`
761770
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
762771

tests/testsuite/package.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5312,7 +5312,7 @@ fn workspace_with_local_deps() {
53125312
53135313
Caused by:
53145314
no matching package named `level2` found
5315-
location searched: registry `crates-io`
5315+
location searched: crates.io index
53165316
required by package `level1 v0.0.1 ([ROOT]/foo/level1)`
53175317
53185318
"#]])
@@ -5496,7 +5496,7 @@ fn workspace_with_local_deps_packaging_one_fails() {
54965496
54975497
Caused by:
54985498
no matching package named `level2` found
5499-
location searched: registry `crates-io`
5499+
location searched: crates.io index
55005500
required by package `level1 v0.0.1 ([ROOT]/foo/target/package/level1-0.0.1)`
55015501
55025502
"#]])
@@ -5523,7 +5523,7 @@ fn workspace_with_local_deps_packaging_one_fails_nightly() {
55235523
55245524
Caused by:
55255525
no matching package named `level2` found
5526-
location searched: registry `crates-io`
5526+
location searched: crates.io index
55275527
required by package `level1 v0.0.1 ([ROOT]/foo/target/package/level1-0.0.1)`
55285528
55295529
"#]])
@@ -5589,7 +5589,7 @@ fn workspace_with_local_deps_packaging_one_bin_fails() {
55895589
55905590
Caused by:
55915591
no matching package named `level2` found
5592-
location searched: registry `crates-io`
5592+
location searched: crates.io index
55935593
required by package `level1 v0.0.1 ([ROOT]/foo/level1)`
55945594
55955595
"#]])
@@ -5809,7 +5809,7 @@ fn workspace_with_local_deps_index_mismatch() {
58095809
58105810
Caused by:
58115811
no matching package named `level2` found
5812-
location searched: registry `crates-io`
5812+
location searched: crates.io index
58135813
required by package `level1 v0.0.1 ([ROOT]/foo/level1)`
58145814
58155815
"#]])
@@ -6620,7 +6620,7 @@ fn unpublishable_dependency() {
66206620
66216621
Caused by:
66226622
no matching package named `dep` found
6623-
location searched: registry `alternative`
6623+
location searched: `alternative` index
66246624
required by package `main v0.0.1 ([ROOT]/foo/main)`
66256625
66266626
"#]])

tests/testsuite/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3932,7 +3932,7 @@ fn workspace_missing_dependency() {
39323932
39333933
Caused by:
39343934
no matching package named `a` found
3935-
location searched: registry `crates-io`
3935+
location searched: crates.io index
39363936
required by package `b v0.0.1 ([ROOT]/foo/target/package/b-0.0.1)`
39373937
39383938
"#]])

tests/testsuite/registry.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn nonexistent_http() {
167167
nonexistent(str![[r#"
168168
[UPDATING] `dummy-registry` index
169169
[ERROR] no matching package named `nonexistent` found
170-
location searched: registry `crates-io`
170+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
171171
required by package `foo v0.0.1 ([ROOT]/foo)`
172172
173173
"#]]);
@@ -178,7 +178,7 @@ fn nonexistent_git() {
178178
nonexistent(str![[r#"
179179
[UPDATING] `dummy-registry` index
180180
[ERROR] no matching package named `nonexistent` found
181-
location searched: registry `crates-io`
181+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
182182
required by package `foo v0.0.1 ([ROOT]/foo)`
183183
184184
"#]]);
@@ -218,7 +218,7 @@ fn wrong_case_http() {
218218
[ERROR] no matching package found
219219
searched package name: `Init`
220220
perhaps you meant: init
221-
location searched: registry `crates-io`
221+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
222222
required by package `foo v0.0.1 ([ROOT]/foo)`
223223
224224
"#]]);
@@ -231,7 +231,7 @@ fn wrong_case_git() {
231231
[ERROR] no matching package found
232232
searched package name: `Init`
233233
perhaps you meant: init
234-
location searched: registry `crates-io`
234+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
235235
required by package `foo v0.0.1 ([ROOT]/foo)`
236236
237237
"#]]);
@@ -272,7 +272,7 @@ fn mis_hyphenated_http() {
272272
[ERROR] no matching package found
273273
searched package name: `mis_hyphenated`
274274
perhaps you meant: mis-hyphenated
275-
location searched: registry `crates-io`
275+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
276276
required by package `foo v0.0.1 ([ROOT]/foo)`
277277
278278
"#]]);
@@ -285,7 +285,7 @@ fn mis_hyphenated_git() {
285285
[ERROR] no matching package found
286286
searched package name: `mis_hyphenated`
287287
perhaps you meant: mis-hyphenated
288-
location searched: registry `crates-io`
288+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
289289
required by package `foo v0.0.1 ([ROOT]/foo)`
290290
291291
"#]]);
@@ -468,7 +468,7 @@ fn update_registry_http() {
468468
str![[r#"
469469
[UPDATING] `dummy-registry` index
470470
[ERROR] no matching package named `notyet` found
471-
location searched: registry `crates-io`
471+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
472472
required by package `foo v0.0.1 ([ROOT]/foo)`
473473
474474
"#]],
@@ -491,7 +491,7 @@ fn update_registry_git() {
491491
str![[r#"
492492
[UPDATING] `dummy-registry` index
493493
[ERROR] no matching package named `notyet` found
494-
location searched: registry `crates-io`
494+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
495495
required by package `foo v0.0.1 ([ROOT]/foo)`
496496
497497
"#]],
@@ -551,7 +551,7 @@ fn package_with_path_deps_http() {
551551
552552
Caused by:
553553
no matching package named `notyet` found
554-
location searched: registry `crates-io`
554+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
555555
required by package `foo v0.0.1 ([ROOT]/foo)`
556556
557557
"#]],
@@ -580,7 +580,7 @@ fn package_with_path_deps_git() {
580580
581581
Caused by:
582582
no matching package named `notyet` found
583-
location searched: registry `crates-io`
583+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
584584
required by package `foo v0.0.1 ([ROOT]/foo)`
585585
586586
"#]],
@@ -925,7 +925,7 @@ fn yanks_in_lockfiles_are_ok_http() {
925925
str![[r#"
926926
[UPDATING] `dummy-registry` index
927927
[ERROR] no matching package named `bar` found
928-
location searched: registry `crates-io`
928+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
929929
required by package `foo v0.0.1 ([ROOT]/foo)`
930930
931931
"#]],
@@ -942,7 +942,7 @@ fn yanks_in_lockfiles_are_ok_git() {
942942
str![[r#"
943943
[UPDATING] `dummy-registry` index
944944
[ERROR] no matching package named `bar` found
945-
location searched: registry `crates-io`
945+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
946946
required by package `foo v0.0.1 ([ROOT]/foo)`
947947
948948
"#]],
@@ -994,7 +994,7 @@ fn yanks_in_lockfiles_are_ok_for_other_update_http() {
994994
str![[r#"
995995
[UPDATING] `dummy-registry` index
996996
[ERROR] no matching package named `bar` found
997-
location searched: registry `crates-io`
997+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
998998
required by package `foo v0.0.1 ([ROOT]/foo)`
999999
10001000
"#]],
@@ -1017,7 +1017,7 @@ fn yanks_in_lockfiles_are_ok_for_other_update_git() {
10171017
str![[r#"
10181018
[UPDATING] `dummy-registry` index
10191019
[ERROR] no matching package named `bar` found
1020-
location searched: registry `crates-io`
1020+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
10211021
required by package `foo v0.0.1 ([ROOT]/foo)`
10221022
10231023
"#]],
@@ -3226,7 +3226,7 @@ fn unknown_index_version_error() {
32263226
.with_stderr_data(str![[r#"
32273227
[UPDATING] `dummy-registry` index
32283228
[ERROR] no matching package named `bar` found
3229-
location searched: registry `crates-io`
3229+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
32303230
required by package `foo v0.1.0 ([ROOT]/foo)`
32313231
32323232
"#]])
@@ -3769,7 +3769,7 @@ foo v0.1.0 ([ROOT]/foo)
37693769
.with_stderr_data(str![[r#"
37703770
[UPDATING] `dummy-registry` index
37713771
[ERROR] no matching package named `bar` found
3772-
location searched: registry `crates-io`
3772+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
37733773
required by package `foo v0.1.0 ([ROOT]/foo)`
37743774
37753775
"#]])
@@ -3863,7 +3863,7 @@ fn not_found_permutations() {
38633863
.with_stderr_data(str![[r#"
38643864
[UPDATING] `dummy-registry` index
38653865
[ERROR] no matching package named `a-b_c` found
3866-
location searched: registry `crates-io`
3866+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
38673867
required by package `foo v0.0.1 ([ROOT]/foo)`
38683868
38693869
"#]])

tests/testsuite/update.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ perhaps a crate was updated and forgotten to be re-vendored?
456456
.with_stderr_data(str![[r#"
457457
[UPDATING] `dummy-registry` index
458458
[ERROR] no matching package named `serde` found
459-
location searched: registry `crates-io`
459+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
460460
required by package `bar v0.0.1 ([ROOT]/foo)`
461461
462462
"#]])
@@ -997,7 +997,7 @@ Caused by:
997997
.with_stderr_data(str![[r#"
998998
[UPDATING] `dummy-registry` index
999999
[ERROR] no matching package named `bar` found
1000-
location searched: registry `crates-io`
1000+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
10011001
required by package `foo v0.1.0 ([ROOT]/foo)`
10021002
10031003
"#]])
@@ -1017,7 +1017,7 @@ required by package `foo v0.1.0 ([ROOT]/foo)`
10171017
.with_stderr_data(str![[r#"
10181018
[UPDATING] `dummy-registry` index
10191019
[ERROR] no matching package named `bar` found
1020-
location searched: registry `crates-io`
1020+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
10211021
required by package `foo v0.1.0 ([ROOT]/foo)`
10221022
10231023
"#]])

0 commit comments

Comments
 (0)