rust-analyzer/crates/tools/tests/cli.rs

23 lines
570 B
Rust
Raw Normal View History

use tools::{generate, gen_tests, run_rustfmt, Verify};
#[test]
fn generated_grammar_is_fresh() {
2018-10-16 17:53:19 +00:00
if let Err(error) = generate(Verify) {
2018-10-16 18:09:22 +00:00
panic!("{}. Please update it by running `cargo gen-syntax`", error);
}
}
#[test]
fn generated_tests_are_fresh() {
if let Err(error) = gen_tests(Verify) {
2019-02-08 11:49:43 +00:00
panic!("{}. Please update tests by running `cargo gen-tests`", error);
}
}
#[test]
fn check_code_formatting() {
if let Err(error) = run_rustfmt(Verify) {
2019-02-08 11:49:43 +00:00
panic!("{}. Please format the code by running `cargo format`", error);
}
}