|
3 | 3 | use cargo_test_support::prelude::*; |
4 | 4 | use cargo_test_support::project; |
5 | 5 | use cargo_test_support::registry::{Package, RegistryBuilder, TestRegistry}; |
| 6 | +use cargo_test_support::str; |
6 | 7 |
|
7 | 8 | fn setup() -> (TestRegistry, String) { |
8 | 9 | let alt = RegistryBuilder::new().alternative().build(); |
@@ -77,17 +78,16 @@ fn registry_version_wins() { |
77 | 78 |
|
78 | 79 | p.cargo("check") |
79 | 80 | .overlay_registry(®.index_url(), &alt_path) |
80 | | - .with_stderr_data( |
81 | | - "\ |
82 | | -[UPDATING] [..] |
| 81 | + .with_stderr_data(str![[r#" |
| 82 | +[UPDATING] `sparse+http://127.0.0.1:[..]/index/` index |
83 | 83 | [LOCKING] 1 package to latest compatible version |
84 | 84 | [DOWNLOADING] crates ... |
85 | | -[DOWNLOADED] baz v0.1.1 (registry [..]) |
| 85 | +[DOWNLOADED] baz v0.1.1 (registry `sparse+http://127.0.0.1:[..]/index/`) |
86 | 86 | [CHECKING] baz v0.1.1 |
87 | 87 | [CHECKING] foo v0.0.1 ([ROOT]/foo) |
88 | 88 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
89 | | -", |
90 | | - ) |
| 89 | +
|
| 90 | +"#]]) |
91 | 91 | .run(); |
92 | 92 | } |
93 | 93 |
|
@@ -120,21 +120,20 @@ fn overlay_version_wins() { |
120 | 120 |
|
121 | 121 | p.cargo("check") |
122 | 122 | .overlay_registry(®.index_url(), &alt_path) |
123 | | - .with_stderr_data( |
124 | | - "\ |
125 | | -[UPDATING] [..] |
| 123 | + .with_stderr_data(str![[r#" |
| 124 | +[UPDATING] `sparse+http://127.0.0.1:[..]/index/` index |
126 | 125 | [LOCKING] 1 package to latest compatible version |
127 | | -[UNPACKING] baz v0.1.1 (registry [..]) |
| 126 | +[UNPACKING] baz v0.1.1 (registry `[ROOT]/alternative-registry`) |
128 | 127 | [CHECKING] baz v0.1.1 |
129 | 128 | [CHECKING] foo v0.0.1 ([ROOT]/foo) |
130 | 129 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
131 | | -", |
132 | | - ) |
| 130 | +
|
| 131 | +"#]]) |
133 | 132 | .run(); |
134 | 133 | } |
135 | 134 |
|
136 | 135 | #[cargo_test] |
137 | | -fn version_collision() { |
| 136 | +fn version_precedence() { |
138 | 137 | let (reg, alt_path) = setup(); |
139 | 138 | let p = project() |
140 | 139 | .file( |
@@ -162,19 +161,15 @@ fn version_collision() { |
162 | 161 |
|
163 | 162 | p.cargo("check") |
164 | 163 | .overlay_registry(®.index_url(), &alt_path) |
165 | | - .with_status(101) |
166 | | - .with_stderr_data( |
167 | | - "\ |
168 | | -[UPDATING] [..] |
169 | | -[ERROR] failed to get `baz` [..] |
170 | | -
|
171 | | -Caused by: |
172 | | - failed to query replaced source registry `crates-io` |
173 | | -
|
174 | | -Caused by: |
175 | | - found a package in the remote registry and the local overlay: baz@0.1.1 |
176 | | -", |
177 | | - ) |
| 164 | + .with_stderr_data(str![[r#" |
| 165 | +[UPDATING] `sparse+http://127.0.0.1:[..]/index/` index |
| 166 | +[LOCKING] 1 package to latest compatible version |
| 167 | +[UNPACKING] baz v0.1.1 (registry `[ROOT]/alternative-registry`) |
| 168 | +[CHECKING] baz v0.1.1 |
| 169 | +[CHECKING] foo v0.0.1 ([ROOT]/foo) |
| 170 | +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
| 171 | +
|
| 172 | +"#]]) |
178 | 173 | .run(); |
179 | 174 | } |
180 | 175 |
|
@@ -248,22 +243,21 @@ fn registry_dep_depends_on_new_local_package() { |
248 | 243 |
|
249 | 244 | p.cargo("check") |
250 | 245 | .overlay_registry(®.index_url(), &alt_path) |
251 | | - .with_stderr_data( |
252 | | - "\ |
253 | | -[UPDATING] [..] |
| 246 | + .with_stderr_data(str![[r#" |
| 247 | +[UPDATING] `sparse+http://127.0.0.1:[..]/index/` index |
254 | 248 | [LOCKING] 3 packages to latest compatible versions |
255 | 249 | [ADDING] workspace-package v0.0.1 (available: v0.1.1) |
256 | 250 | [DOWNLOADING] crates ... |
257 | | -[UNPACKING] [..] |
258 | | -[DOWNLOADED] [..] |
259 | | -[DOWNLOADED] [..] |
| 251 | +[UNPACKING] workspace-package v0.1.1 (registry `[ROOT]/alternative-registry`) |
| 252 | +[DOWNLOADED] registry-package v0.1.0 (registry `sparse+http://127.0.0.1:[..]/index/`) |
| 253 | +[DOWNLOADED] workspace-package v0.0.1 (registry `sparse+http://127.0.0.1:[..]/index/`) |
260 | 254 | [CHECKING] workspace-package v0.1.1 |
261 | 255 | [CHECKING] workspace-package v0.0.1 |
262 | 256 | [CHECKING] registry-package v0.1.0 |
263 | | -[CHECKING] foo v0.0.1 [..] |
| 257 | +[CHECKING] foo v0.0.1 ([ROOT]/foo) |
264 | 258 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
265 | | -", |
266 | | - ) |
| 259 | +
|
| 260 | +"#]]) |
267 | 261 | .run(); |
268 | 262 | } |
269 | 263 |
|
|
0 commit comments