aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/tests/cli.rs
blob: aab52a4aaa6c38646fbdd368c7bc84dab3aa32d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use tools::{generate, gen_tests, run_rustfmt, Verify};

#[test]
fn generated_grammar_is_fresh() {
    if let Err(error) = generate(Verify) {
        panic!("{}. Please update it by running `cargo gen-syntax`", error);
    }
}

#[test]
fn generated_tests_are_fresh() {
    if let Err(error) = gen_tests(Verify) {
        panic!("{}. Please update tests by running `cargo gen-tests`", error);
    }
}

#[test]
fn check_code_formatting() {
    if let Err(error) = run_rustfmt(Verify) {
        panic!("{}. Please format the code by running `cargo format`", error);
    }
}