mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-24 19:05:06 +00:00
61f3a438d3
Run `cargo fmt` and ignore generated files
23 lines
683 B
Rust
23 lines
683 B
Rust
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);
|
|
}
|
|
}
|