diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-17 09:40:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-17 09:40:02 +0100 |
commit | 69f0cb6cd77c2dc93f2eed180a6c16fd8c3fca5a (patch) | |
tree | ced37e68dbf7801bdfc1f4e8c0afa4c032904cb3 /xtask | |
parent | d426462b487d9b8ec18184fb169b8fcd990a80d5 (diff) | |
parent | 828f69ce549c9e07dec528247c97507749b1aec7 (diff) |
Merge #4008
4008: tests: add more info about what failed in tidy tests r=matklad a=bnjjj
Separate PR from #3954
Co-authored-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/tests/tidy-tests/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xtask/tests/tidy-tests/main.rs b/xtask/tests/tidy-tests/main.rs index 101ae19bd..ead642acc 100644 --- a/xtask/tests/tidy-tests/main.rs +++ b/xtask/tests/tidy-tests/main.rs | |||
@@ -35,7 +35,7 @@ fn check_todo(path: &Path, text: &str) { | |||
35 | } | 35 | } |
36 | if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { | 36 | if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { |
37 | panic!( | 37 | panic!( |
38 | "\nTODO markers should not be committed to the master branch,\n\ | 38 | "\nTODO markers or todo! macros should not be committed to the master branch,\n\ |
39 | use FIXME instead\n\ | 39 | use FIXME instead\n\ |
40 | {}\n", | 40 | {}\n", |
41 | path.display(), | 41 | path.display(), |
@@ -47,9 +47,9 @@ fn check_trailing_ws(path: &Path, text: &str) { | |||
47 | if is_exclude_dir(path, &["test_data"]) { | 47 | if is_exclude_dir(path, &["test_data"]) { |
48 | return; | 48 | return; |
49 | } | 49 | } |
50 | for line in text.lines() { | 50 | for (line_number, line) in text.lines().enumerate() { |
51 | if line.chars().last().map(char::is_whitespace) == Some(true) { | 51 | if line.chars().last().map(char::is_whitespace) == Some(true) { |
52 | panic!("Trailing whitespace in {}", path.display()) | 52 | panic!("Trailing whitespace in {} at line {}", path.display(), line_number) |
53 | } | 53 | } |
54 | } | 54 | } |
55 | } | 55 | } |