aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/tests/cli.rs
blob: 16899bb5f434d83092bc5d36847e920365949b41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern crate tools;

use tools::{
    project_root, render_template, update, AST, AST_TEMPLATE, SYNTAX_KINDS, SYNTAX_KINDS_TEMPLATE,
};

#[test]
fn verify_template_generation() {
    if let Err(error) = update(
        &project_root().join(SYNTAX_KINDS),
        &render_template(&project_root().join(SYNTAX_KINDS_TEMPLATE)).unwrap(),
        true,
    ) {
        panic!("{}. Please update it by running `cargo gen-kinds`", error);
    }
    if let Err(error) = update(
        &project_root().join(AST),
        &render_template(&project_root().join(AST_TEMPLATE)).unwrap(),
        true,
    ) {
        panic!("{}. Please update it by running `cargo gen-kinds`", error);
    }
}