1
1
//! Tests for selecting pre-release versions with `update --precise`.
2
2
3
- #![ allow( deprecated) ]
4
-
5
- use cargo_test_support:: project;
3
+ use cargo_test_support:: { project, str} ;
6
4
7
5
#[ cargo_test]
8
6
fn requires_nightly_cargo ( ) {
@@ -29,16 +27,17 @@ fn requires_nightly_cargo() {
29
27
. with_status ( 101 )
30
28
// This error is suffering from #12579 but still demonstrates that updating to
31
29
// a pre-release does not work on stable
32
- . with_stderr (
33
- r#" [UPDATING] `dummy-registry` index
30
+ . with_stderr_data ( str! [ [ r#"
31
+ [UPDATING] `dummy-registry` index
34
32
[ERROR] failed to select a version for the requirement `my-dependency = "^0.1.1"`
35
33
candidate versions found which didn't match: 0.1.2-pre.0
36
34
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
37
35
required by package `package v0.0.0 ([ROOT]/foo)`
38
36
if you are looking for the prerelease package it needs to be specified explicitly
39
37
my-dependency = { version = "0.1.2-pre.0" }
40
- perhaps a crate was updated and forgotten to be re-vendored?"# ,
41
- )
38
+ perhaps a crate was updated and forgotten to be re-vendored?
39
+
40
+ "# ] ] )
42
41
. run ( )
43
42
}
44
43
@@ -65,11 +64,11 @@ fn update_pre_release() {
65
64
66
65
p. cargo ( "update my-dependency --precise 0.1.2-pre.0 -Zunstable-options" )
67
66
. masquerade_as_nightly_cargo ( & [ "precise-pre-release" ] )
68
- . with_stderr (
69
- r#" [UPDATING] `dummy-registry` index
67
+ . with_stderr_data ( str! [ [ r#"
68
+ [UPDATING] `dummy-registry` index
70
69
[UPDATING] my-dependency v0.1.1 -> v0.1.2-pre.0
71
- "# ,
72
- )
70
+
71
+ "# ] ] )
73
72
. run ( ) ;
74
73
let lockfile = p. read_lockfile ( ) ;
75
74
assert ! ( lockfile. contains( "\n name = \" my-dependency\" \n version = \" 0.1.2-pre.0\" " ) ) ;
@@ -98,20 +97,20 @@ fn update_pre_release_differ() {
98
97
99
98
p. cargo ( "update -p my-dependency --precise 0.1.2-pre.0 -Zunstable-options" )
100
99
. masquerade_as_nightly_cargo ( & [ "precise-pre-release" ] )
101
- . with_stderr (
102
- r#" [UPDATING] `dummy-registry` index
100
+ . with_stderr_data ( str! [ [ r#"
101
+ [UPDATING] `dummy-registry` index
103
102
[DOWNGRADING] my-dependency v0.1.2 -> v0.1.2-pre.0
104
- "# ,
105
- )
103
+
104
+ "# ] ] )
106
105
. run ( ) ;
107
106
108
107
p. cargo ( "update -p my-dependency --precise 0.1.2-pre.1 -Zunstable-options" )
109
108
. masquerade_as_nightly_cargo ( & [ "precise-pre-release" ] )
110
- . with_stderr (
111
- r#" [UPDATING] `dummy-registry` index
109
+ . with_stderr_data ( str! [ [ r#"
110
+ [UPDATING] `dummy-registry` index
112
111
[UPDATING] my-dependency v0.1.2-pre.0 -> v0.1.2-pre.1
113
- "# ,
114
- )
112
+
113
+ "# ] ] )
115
114
. run ( ) ;
116
115
117
116
let lockfile = p. read_lockfile ( ) ;
0 commit comments