2018-10-14 09:32:57 -05:00
|
|
|
extern crate tools;
|
|
|
|
|
2018-10-15 16:44:23 -05:00
|
|
|
use tools::{
|
|
|
|
project_root, render_template, update, AST, AST_TEMPLATE, SYNTAX_KINDS, SYNTAX_KINDS_TEMPLATE,
|
|
|
|
};
|
2018-10-14 09:32:57 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn verify_template_generation() {
|
2018-10-15 16:44:23 -05:00
|
|
|
if let Err(error) = update(
|
|
|
|
&project_root().join(SYNTAX_KINDS),
|
|
|
|
&render_template(&project_root().join(SYNTAX_KINDS_TEMPLATE)).unwrap(),
|
|
|
|
true,
|
|
|
|
) {
|
2018-10-14 09:58:53 -05:00
|
|
|
panic!("{}. Please update it by running `cargo gen-kinds`", error);
|
|
|
|
}
|
2018-10-15 16:44:23 -05:00
|
|
|
if let Err(error) = update(
|
|
|
|
&project_root().join(AST),
|
|
|
|
&render_template(&project_root().join(AST_TEMPLATE)).unwrap(),
|
|
|
|
true,
|
|
|
|
) {
|
2018-10-14 09:58:53 -05:00
|
|
|
panic!("{}. Please update it by running `cargo gen-kinds`", error);
|
|
|
|
}
|
2018-10-15 12:52:11 -05:00
|
|
|
}
|