2018-10-14 09:32:57 -05:00
|
|
|
extern crate tools;
|
|
|
|
|
2018-10-31 15:41:43 -05:00
|
|
|
use tools::{generate, run_rustfmt, Verify};
|
2018-10-14 09:32:57 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn verify_template_generation() {
|
2018-10-16 12:53:19 -05:00
|
|
|
if let Err(error) = generate(Verify) {
|
2018-10-16 13:09:22 -05:00
|
|
|
panic!("{}. Please update it by running `cargo gen-syntax`", error);
|
2018-10-14 09:58:53 -05:00
|
|
|
}
|
2018-10-15 12:52:11 -05:00
|
|
|
}
|
2018-10-31 14:50:43 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn check_code_formatting() {
|
|
|
|
if let Err(error) = run_rustfmt(Verify) {
|
2018-10-31 15:41:43 -05:00
|
|
|
panic!(
|
|
|
|
"{}. Please format the code by running `cargo format`",
|
|
|
|
error
|
|
|
|
);
|
2018-10-31 14:50:43 -05:00
|
|
|
}
|
|
|
|
}
|