Skip to content

Commit 750af76

Browse files
committed
test: Adjust update-breaking tests.
1 parent 2607661 commit 750af76

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

tests/testsuite/update.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn change_package_version() {
362362
}
363363

364364
#[cargo_test]
365-
fn update_precise() {
365+
fn update_precise_downgrade() {
366366
Package::new("serde", "0.1.0").publish();
367367
Package::new("serde", "0.2.1").publish();
368368

@@ -1411,7 +1411,7 @@ fn update_precise_git_revisions() {
14111411
}
14121412

14131413
#[cargo_test]
1414-
fn precise_yanked() {
1414+
fn update_precise_yanked() {
14151415
Package::new("bar", "0.1.0").publish();
14161416
Package::new("bar", "0.1.1").yanked(true).publish();
14171417
let p = project()
@@ -1450,7 +1450,7 @@ fn precise_yanked() {
14501450
}
14511451

14521452
#[cargo_test]
1453-
fn precise_yanked_multiple_presence() {
1453+
fn update_precise_yanked_multiple_presence() {
14541454
Package::new("bar", "0.1.0").publish();
14551455
Package::new("bar", "0.1.1").yanked(true).publish();
14561456
let p = project()
@@ -1631,8 +1631,8 @@ fn update_breaking_unstable() {
16311631
.file("src/lib.rs", "")
16321632
.build();
16331633

1634-
p.cargo("update --breaking")
1635-
.masquerade_as_nightly_cargo(&["update-breaking"])
1634+
p.cargo("update --breaking")
1635+
.masquerade_as_nightly_cargo(&[])
16361636
.with_status(101)
16371637
.with_stderr_data(str![[r#"
16381638
[ERROR] the `--breaking` flag is unstable, pass `-Z unstable-options` to enable it
@@ -1687,7 +1687,7 @@ fn update_breaking_dry_run() {
16871687
Package::new("ws", "2.0.0").publish();
16881688

16891689
p.cargo("update -Zunstable-options --dry-run --breaking")
1690-
.masquerade_as_nightly_cargo(&["update-breaking"])
1690+
.masquerade_as_nightly_cargo(&[])
16911691
.with_stderr_data(str![[r#"
16921692
[UPDATING] `dummy-registry` index
16931693
[UPGRADING] incompatible ^1.0 -> ^2.0
@@ -1886,7 +1886,7 @@ fn update_breaking() {
18861886
Package::new("build", "2.0.0").publish();
18871887

18881888
p.cargo("update -Zunstable-options --breaking")
1889-
.masquerade_as_nightly_cargo(&["update-breaking"])
1889+
.masquerade_as_nightly_cargo(&[])
18901890
.with_stderr_data(str![[r#"
18911891
[UPDATING] `alternative` index
18921892
[UPGRADING] multiple-registries ^2.0 -> ^3.0
@@ -2096,7 +2096,7 @@ fn update_breaking_specific_packages() {
20962096
Package::new("transitive-incompatible", "2.0.0").publish();
20972097

20982098
p.cargo("update -Zunstable-options --breaking just-foo shared ws")
2099-
.masquerade_as_nightly_cargo(&["update-breaking"])
2099+
.masquerade_as_nightly_cargo(&[])
21002100
.with_stderr_data(str![[r#"
21012101
[UPDATING] `dummy-registry` index
21022102
[UPGRADING] shared ^1.0 -> ^2.0
@@ -2160,7 +2160,7 @@ fn update_breaking_specific_packages_that_wont_update() {
21602160
Package::new("transitive-incompatible", "2.0.0").publish();
21612161

21622162
p.cargo("update -Zunstable-options --breaking compatible renamed-from non-semver transitive-compatible transitive-incompatible")
2163-
.masquerade_as_nightly_cargo(&["update-breaking"])
2163+
.masquerade_as_nightly_cargo(&[])
21642164
.with_stderr_data(str![[r#"
21652165
[UPDATING] `[..]` index
21662166
@@ -2218,7 +2218,7 @@ fn update_breaking_without_lock_file() {
22182218
Package::new("incompatible", "2.0.0").publish();
22192219

22202220
p.cargo("update -Zunstable-options --breaking")
2221-
.masquerade_as_nightly_cargo(&["update-breaking"])
2221+
.masquerade_as_nightly_cargo(&[])
22222222
.with_stderr_data(str![[r#"
22232223
[UPDATING] `[..]` index
22242224
[UPGRADING] incompatible ^1.0 -> ^2.0
@@ -2260,7 +2260,7 @@ fn update_breaking_spec_version() {
22602260

22612261
// Invalid spec
22622262
p.cargo("update -Zunstable-options --breaking incompatible@foo")
2263-
.masquerade_as_nightly_cargo(&["update-breaking"])
2263+
.masquerade_as_nightly_cargo(&[])
22642264
.with_status(101)
22652265
.with_stderr_data(str![[r#"
22662266
[ERROR] expected a version like "1.32"
@@ -2270,19 +2270,19 @@ fn update_breaking_spec_version() {
22702270

22712271
// Spec version not matching our current dependencies
22722272
p.cargo("update -Zunstable-options --breaking [email protected]")
2273-
.masquerade_as_nightly_cargo(&["update-breaking"])
22742273
.with_stderr_data(str![[r#""#]])
2274+
.masquerade_as_nightly_cargo(&[])
22752275
.run();
22762276

22772277
// Spec source not matching our current dependencies
22782278
p.cargo("update -Zunstable-options --breaking https://alternative.com#[email protected]")
2279-
.masquerade_as_nightly_cargo(&["update-breaking"])
22802279
.with_stderr_data(str![[r#""#]])
2280+
.masquerade_as_nightly_cargo(&[])
22812281
.run();
22822282

22832283
// Accepted spec
22842284
p.cargo("update -Zunstable-options --breaking [email protected]")
2285-
.masquerade_as_nightly_cargo(&["update-breaking"])
2285+
.masquerade_as_nightly_cargo(&[])
22862286
.with_stderr_data(str![[r#"
22872287
[UPDATING] `[..]` index
22882288
[UPGRADING] incompatible ^1.0 -> ^2.0
@@ -2295,7 +2295,7 @@ fn update_breaking_spec_version() {
22952295
// Accepted spec, full format
22962296
Package::new("incompatible", "3.0.0").publish();
22972297
p.cargo("update -Zunstable-options --breaking https://github.com/rust-lang/crates.io-index#[email protected]")
2298-
.masquerade_as_nightly_cargo(&["update-breaking"])
2298+
.masquerade_as_nightly_cargo(&[])
22992299
.with_stderr_data(str![[r#"
23002300
[UPDATING] `[..]` index
23012301
[UPGRADING] incompatible ^2.0 -> ^3.0
@@ -2307,7 +2307,7 @@ fn update_breaking_spec_version() {
23072307

23082308
// Spec matches a dependency that will not be upgraded
23092309
p.cargo("update -Zunstable-options --breaking [email protected]")
2310-
.masquerade_as_nightly_cargo(&["update-breaking"])
2310+
.masquerade_as_nightly_cargo(&[])
23112311
.with_stderr_data(str![[r#"
23122312
[UPDATING] `[..]` index
23132313
@@ -2316,20 +2316,20 @@ fn update_breaking_spec_version() {
23162316

23172317
// Non-existing versions
23182318
p.cargo("update -Zunstable-options --breaking [email protected]")
2319-
.masquerade_as_nightly_cargo(&["update-breaking"])
23202319
.with_stderr_data(str![[r#""#]])
2320+
.masquerade_as_nightly_cargo(&[])
23212321
.run();
23222322

23232323
p.cargo("update -Zunstable-options --breaking [email protected]")
2324-
.masquerade_as_nightly_cargo(&["update-breaking"])
23252324
.with_stderr_data(str![[r#""#]])
2325+
.masquerade_as_nightly_cargo(&[])
23262326
.run();
23272327
}
23282328

23292329
#[cargo_test]
23302330
fn update_breaking_spec_version_transitive() {
23312331
Package::new("dep", "1.0.0").publish();
2332-
Package::new("dep", "1.1.0").publish();
2332+
Package::new("dep", "2.0.0").publish();
23332333

23342334
let p = project()
23352335
.file(
@@ -2357,44 +2357,44 @@ fn update_breaking_spec_version_transitive() {
23572357
authors = []
23582358
23592359
[dependencies]
2360-
dep = "1.1"
2360+
dep = "2.0"
23612361
"#,
23622362
)
23632363
.file("bar/src/lib.rs", "")
23642364
.build();
23652365

23662366
p.cargo("generate-lockfile").run();
23672367

2368-
Package::new("dep", "1.1.1").publish();
2369-
Package::new("dep", "2.0.0").publish();
2368+
Package::new("dep", "2.0.1").publish();
2369+
Package::new("dep", "3.0.0").publish();
23702370

23712371
// Will upgrade the direct dependency
23722372
p.cargo("update -Zunstable-options --breaking [email protected]")
2373-
.masquerade_as_nightly_cargo(&["update-breaking"])
2373+
.masquerade_as_nightly_cargo(&[])
23742374
.with_stderr_data(str![[r#"
23752375
[UPDATING] `[..]` index
2376-
[UPGRADING] dep ^1.0 -> ^2.0
2376+
[UPGRADING] dep ^1.0 -> ^3.0
23772377
[LOCKING] 1 package to latest compatible version
2378-
[ADDING] dep v2.0.0
2378+
[UPDATING] dep v1.0.0 -> v3.0.0
23792379
23802380
"#]])
23812381
.run();
23822382

23832383
// But not the transitive one, because bar is not a workspace member
2384-
p.cargo("update -Zunstable-options --breaking dep@1.1")
2385-
.masquerade_as_nightly_cargo(&["update-breaking"])
2384+
p.cargo("update -Zunstable-options --breaking dep@2.0")
2385+
.masquerade_as_nightly_cargo(&[])
23862386
.with_stderr_data(str![[r#"
23872387
[UPDATING] `[..]` index
23882388
23892389
"#]])
23902390
.run();
23912391

23922392
// A non-breaking update is different, as it will update transitive dependencies
2393-
p.cargo("update dep@1.1")
2393+
p.cargo("update dep@2.0")
23942394
.with_stderr_data(str![[r#"
23952395
[UPDATING] `[..]` index
23962396
[LOCKING] 1 package to latest compatible version
2397-
[UPDATING] dep v1.1.0 -> v1.1.1 (latest: v2.0.0)
2397+
[UPDATING] dep v2.0.0 -> v2.0.1 (latest: v3.0.0)
23982398
23992399
"#]])
24002400
.run();
@@ -2448,7 +2448,7 @@ fn update_breaking_mixed_compatibility() {
24482448
Package::new("mixed-compatibility", "2.0.1").publish();
24492449

24502450
p.cargo("update -Zunstable-options --breaking")
2451-
.masquerade_as_nightly_cargo(&["update-breaking"])
2451+
.masquerade_as_nightly_cargo(&[])
24522452
.with_stderr_data(str![[r#"
24532453
[UPDATING] `[..]` index
24542454
[UPGRADING] mixed-compatibility ^1.0 -> ^2.0
@@ -2534,7 +2534,7 @@ fn update_breaking_mixed_pinning_renaming() {
25342534
Package::new("renamed-from", "2.0.0").publish();
25352535

25362536
p.cargo("update -Zunstable-options --breaking")
2537-
.masquerade_as_nightly_cargo(&["update-breaking"])
2537+
.masquerade_as_nightly_cargo(&[])
25382538
.with_stderr_data(str![[r#"
25392539
[UPDATING] `[..]` index
25402540
[UPGRADING] mixed-pinned ^1.0 -> ^2.0

0 commit comments

Comments
 (0)