rust/crates/tools/tests/cli.rs

20 lines
414 B
Rust
Raw Normal View History

extern crate tools;
use tools::{
generate, Verify, run_rustfmt,
};
#[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);
}
}
#[test]
fn check_code_formatting() {
if let Err(error) = run_rustfmt(Verify) {
panic!("{}. Please format the code by running `cargo format`", error);
}
}