2019-10-23 15:13:40 +00:00
|
|
|
use xtask::{
|
|
|
|
codegen::{self, Mode},
|
2020-03-17 09:26:29 +00:00
|
|
|
run_rustfmt,
|
2019-10-23 15:13:40 +00:00
|
|
|
};
|
2018-10-14 14:32:57 +00:00
|
|
|
|
|
|
|
#[test]
|
2019-01-26 23:03:52 +00:00
|
|
|
fn generated_grammar_is_fresh() {
|
2019-10-23 15:13:40 +00:00
|
|
|
if let Err(error) = codegen::generate_syntax(Mode::Verify) {
|
2019-10-17 20:01:53 +00:00
|
|
|
panic!("{}. Please update it by running `cargo xtask codegen`", error);
|
2018-10-14 14:58:53 +00:00
|
|
|
}
|
2018-10-15 17:52:11 +00:00
|
|
|
}
|
2018-10-31 19:50:43 +00:00
|
|
|
|
2019-01-26 23:03:52 +00:00
|
|
|
#[test]
|
|
|
|
fn generated_tests_are_fresh() {
|
2019-10-23 15:13:40 +00:00
|
|
|
if let Err(error) = codegen::generate_parser_tests(Mode::Verify) {
|
2019-10-23 15:17:24 +00:00
|
|
|
panic!("{}. Please update tests by running `cargo xtask codegen`", error);
|
2019-01-26 23:03:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-25 11:16:46 +00:00
|
|
|
#[test]
|
|
|
|
fn generated_assists_are_fresh() {
|
|
|
|
if let Err(error) = codegen::generate_assists_docs(Mode::Verify) {
|
|
|
|
panic!("{}. Please update assists by running `cargo xtask codegen`", error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-31 19:50:43 +00:00
|
|
|
#[test]
|
|
|
|
fn check_code_formatting() {
|
2019-10-23 15:13:40 +00:00
|
|
|
if let Err(error) = run_rustfmt(Mode::Verify) {
|
2019-02-08 11:49:43 +00:00
|
|
|
panic!("{}. Please format the code by running `cargo format`", error);
|
2018-10-31 19:50:43 +00:00
|
|
|
}
|
|
|
|
}
|