We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[test]
1 parent c0df742 commit 6a4def0Copy full SHA for 6a4def0
src/tools/tidy/src/unit_tests.rs
@@ -13,14 +13,16 @@ pub fn check(path: &Path, bad: &mut bool) {
13
&mut |entry, contents| {
14
let subpath = entry.path();
15
if let Some("rs") = subpath.extension().and_then(|e| e.to_str()) {
16
- let contents = contents.trim();
17
- if !contents.starts_with("//") && contents.contains("#[test]") {
18
- tidy_error!(
19
- bad,
20
- "`{}` contains `#[test]`; libcore tests must be placed inside \
21
- `src/libcore/tests/`",
22
- subpath.display()
23
- );
+ for line in contents.lines() {
+ let line = line.trim();
+ if !line.starts_with("//") && line.contains("#[test]") {
+ tidy_error!(
+ bad,
+ "`{}` contains `#[test]`; libcore tests must be placed inside \
+ `src/libcore/tests/`",
+ subpath.display()
24
+ );
25
+ }
26
}
27
28
},
0 commit comments