Skip to content

Commit 8a45e5c

Browse files
committed
Format pub_priv test
1 parent 8185564 commit 8a45e5c

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

tests/testsuite/pub_priv.rs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
use crate::support::registry::Package;
2-
use crate::support::{project, is_nightly};
2+
use crate::support::{is_nightly, project};
33

44
#[test]
55
fn exported_priv_warning() {
66
if !is_nightly() {
77
return;
88
}
99
Package::new("priv_dep", "0.1.0")
10-
.file(
11-
"src/lib.rs",
12-
"pub struct FromPriv;"
13-
)
10+
.file("src/lib.rs", "pub struct FromPriv;")
1411
.publish();
1512

1613
let p = project()
@@ -58,10 +55,7 @@ fn exported_pub_dep() {
5855
return;
5956
}
6057
Package::new("pub_dep", "0.1.0")
61-
.file(
62-
"src/lib.rs",
63-
"pub struct FromPub;"
64-
)
58+
.file("src/lib.rs", "pub struct FromPub;")
6559
.publish();
6660

6761
let p = project()
@@ -97,10 +91,9 @@ fn exported_pub_dep() {
9791
[COMPILING] pub_dep v0.1.0
9892
[COMPILING] foo v0.0.1 ([CWD])
9993
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
100-
"
94+
",
10195
)
10296
.run()
103-
10497
}
10598

10699
#[test]
@@ -112,10 +105,7 @@ pub fn requires_nightly_cargo() {
112105
cargo-features = ["public-dependency"]
113106
"#,
114107
)
115-
.file(
116-
"src/lib.rs",
117-
""
118-
)
108+
.file("src/lib.rs", "")
119109
.build();
120110

121111
p.cargo("build --message-format=short")
@@ -134,16 +124,10 @@ See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more inform
134124

135125
#[test]
136126
fn requires_feature() {
137-
138-
139127
Package::new("pub_dep", "0.1.0")
140-
.file(
141-
"src/lib.rs",
142-
""
143-
)
128+
.file("src/lib.rs", "")
144129
.publish();
145130

146-
147131
let p = project()
148132
.file(
149133
"Cargo.toml",
@@ -157,10 +141,7 @@ fn requires_feature() {
157141
pub_dep = { version = "0.1.0", public = true }
158142
"#,
159143
)
160-
.file(
161-
"src/lib.rs",
162-
""
163-
)
144+
.file("src/lib.rs", "")
164145
.build();
165146

166147
p.cargo("build --message-format=short")
@@ -174,8 +155,7 @@ Caused by:
174155
feature `public-dependency` is required
175156
176157
consider adding `cargo-features = [\"public-dependency\"]` to the manifest
177-
"
158+
",
178159
)
179160
.run()
180-
181161
}

0 commit comments

Comments
 (0)