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