Skip to content

Commit 845d477

Browse files
committed
Simplify tidy tests
1 parent eea4311 commit 845d477

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

xtask/tests/tidy-tests/cli.rs

Lines changed: 0 additions & 32 deletions
This file was deleted.

xtask/tests/tidy-tests/main.rs renamed to xtask/tests/tidy.rs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1-
mod cli;
2-
31
use std::{
42
collections::HashMap,
53
path::{Path, PathBuf},
64
};
75

8-
use xtask::{not_bash::fs2, project_root, rust_files};
6+
use xtask::{
7+
codegen::{self, Mode},
8+
not_bash::fs2,
9+
project_root, run_rustfmt, rust_files,
10+
};
11+
12+
#[test]
13+
fn generated_grammar_is_fresh() {
14+
if let Err(error) = codegen::generate_syntax(Mode::Verify) {
15+
panic!("{}. Please update it by running `cargo xtask codegen`", error);
16+
}
17+
}
18+
19+
#[test]
20+
fn generated_tests_are_fresh() {
21+
if let Err(error) = codegen::generate_parser_tests(Mode::Verify) {
22+
panic!("{}. Please update tests by running `cargo xtask codegen`", error);
23+
}
24+
}
25+
26+
#[test]
27+
fn generated_assists_are_fresh() {
28+
if let Err(error) = codegen::generate_assists_docs(Mode::Verify) {
29+
panic!("{}. Please update assists by running `cargo xtask codegen`", error);
30+
}
31+
}
32+
33+
#[test]
34+
fn check_code_formatting() {
35+
if let Err(error) = run_rustfmt(Mode::Verify) {
36+
panic!("{}. Please format the code by running `cargo format`", error);
37+
}
38+
}
939

1040
#[test]
1141
fn rust_files_are_tidy() {

0 commit comments

Comments
 (0)