diff options
author | Seivan Heidari <[email protected]> | 2019-10-31 08:43:20 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-10-31 08:43:20 +0000 |
commit | 8edda0e7b164009d6c03bb3d4be603fb38ad2e2a (patch) | |
tree | 744cf81075d394e2f9c06afb07642a2601800dda /xtask/tests/tidy-tests | |
parent | 49562d36b97ddde34cf7585a8c2e8f232519b657 (diff) | |
parent | d067afb064a7fa67b172abf561b7d80740cd6f18 (diff) |
Merge branch 'master' into feature/themes
Diffstat (limited to 'xtask/tests/tidy-tests')
-rw-r--r-- | xtask/tests/tidy-tests/cli.rs | 7 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/docs.rs | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/xtask/tests/tidy-tests/cli.rs b/xtask/tests/tidy-tests/cli.rs index 543c7d7c4..573ffadbf 100644 --- a/xtask/tests/tidy-tests/cli.rs +++ b/xtask/tests/tidy-tests/cli.rs | |||
@@ -19,6 +19,13 @@ fn generated_tests_are_fresh() { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | #[test] | 21 | #[test] |
22 | fn generated_assists_are_fresh() { | ||
23 | if let Err(error) = codegen::generate_assists_docs(Mode::Verify) { | ||
24 | panic!("{}. Please update assists by running `cargo xtask codegen`", error); | ||
25 | } | ||
26 | } | ||
27 | |||
28 | #[test] | ||
22 | fn check_code_formatting() { | 29 | fn check_code_formatting() { |
23 | if let Err(error) = run_rustfmt(Mode::Verify) { | 30 | if let Err(error) = run_rustfmt(Mode::Verify) { |
24 | panic!("{}. Please format the code by running `cargo format`", error); | 31 | panic!("{}. Please format the code by running `cargo format`", error); |
diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index fe5852bc6..6a629ce63 100644 --- a/xtask/tests/tidy-tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs | |||
@@ -8,7 +8,9 @@ use walkdir::{DirEntry, WalkDir}; | |||
8 | use xtask::project_root; | 8 | use xtask::project_root; |
9 | 9 | ||
10 | fn is_exclude_dir(p: &Path) -> bool { | 10 | fn is_exclude_dir(p: &Path) -> bool { |
11 | let exclude_dirs = ["tests", "test_data"]; | 11 | // Test hopefully don't really need comments, and for assists we already |
12 | // have special comments which are source of doc tests and user docs. | ||
13 | let exclude_dirs = ["tests", "test_data", "assists"]; | ||
12 | let mut cur_path = p; | 14 | let mut cur_path = p; |
13 | while let Some(path) = cur_path.parent() { | 15 | while let Some(path) = cur_path.parent() { |
14 | if exclude_dirs.iter().any(|dir| path.ends_with(dir)) { | 16 | if exclude_dirs.iter().any(|dir| path.ends_with(dir)) { |
@@ -27,7 +29,7 @@ fn is_exclude_file(d: &DirEntry) -> bool { | |||
27 | } | 29 | } |
28 | 30 | ||
29 | fn is_hidden(entry: &DirEntry) -> bool { | 31 | fn is_hidden(entry: &DirEntry) -> bool { |
30 | entry.file_name().to_str().map(|s| s.starts_with(".")).unwrap_or(false) | 32 | entry.file_name().to_str().map(|s| s.starts_with('.')).unwrap_or(false) |
31 | } | 33 | } |
32 | 34 | ||
33 | #[test] | 35 | #[test] |