Add test to make sure -Wunused-crate-dependencies works with tests

Make sure code in `#[test]` blocks counts as a use of a crate.
This commit is contained in:
Jeremy Fitzhardinge 2020-05-28 14:40:07 -07:00
parent 4512721156
commit ce81d15289

View File

@ -0,0 +1,15 @@
// Test-only use OK
// edition:2018
// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--test
#![deny(unused_crate_dependencies)]
fn main() {}
#[test]
fn test_bar() {
assert_eq!(bar::BAR, "bar");
}