Skip to content

Commit ccf5c64

Browse files
committed
test(lints): Verify dependency behavior
1 parent 0407a7f commit ccf5c64

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

tests/testsuite/lints.rs

+46
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,52 @@ switch to nightly channel you can add
6969
.run();
7070
}
7171

72+
#[cargo_test]
73+
fn dependency_warning_ignored() {
74+
let foo = project()
75+
.file(
76+
"Cargo.toml",
77+
r#"
78+
[package]
79+
name = "foo"
80+
version = "0.0.1"
81+
authors = []
82+
83+
[dependencies]
84+
bar.path = "../bar"
85+
"#,
86+
)
87+
.file("src/lib.rs", "")
88+
.build();
89+
90+
let _bar = project()
91+
.at("bar")
92+
.file(
93+
"Cargo.toml",
94+
r#"
95+
[package]
96+
name = "bar"
97+
version = "0.0.1"
98+
authors = []
99+
100+
[lints.rust]
101+
unsafe_code = "forbid"
102+
"#,
103+
)
104+
.file("src/lib.rs", "")
105+
.build();
106+
107+
foo.cargo("check")
108+
.with_stderr(
109+
"\
110+
[CHECKING] [..]
111+
[CHECKING] [..]
112+
[FINISHED] [..]
113+
",
114+
)
115+
.run();
116+
}
117+
72118
#[cargo_test]
73119
fn malformed_on_stable() {
74120
let foo = project()

0 commit comments

Comments
 (0)