diff options
author | Muhammad Mominul Huque <[email protected]> | 2018-10-14 15:32:57 +0100 |
---|---|---|
committer | Muhammad Mominul Huque <[email protected]> | 2018-10-14 15:32:57 +0100 |
commit | 114e9a2d74f1fa43c3418f8cd978fd4186fcb78b (patch) | |
tree | 922ec7c131d19594b37c0185f894a696f3e577e7 /crates/tools/tests | |
parent | 2ba6f18586d02a6dbc32e0bea88f7b4236277ea1 (diff) |
create cli.rs and make the tests passing
Diffstat (limited to 'crates/tools/tests')
-rw-r--r-- | crates/tools/tests/cli.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/tools/tests/cli.rs b/crates/tools/tests/cli.rs new file mode 100644 index 000000000..26d9a991c --- /dev/null +++ b/crates/tools/tests/cli.rs | |||
@@ -0,0 +1,16 @@ | |||
1 | extern crate tools; | ||
2 | |||
3 | use std::path::Path; | ||
4 | use tools::{render_template, update}; | ||
5 | |||
6 | const GRAMMAR: &str = "../ra_syntax/src/grammar.ron"; | ||
7 | const SYNTAX_KINDS: &str = "../ra_syntax/src/syntax_kinds/generated.rs"; | ||
8 | const SYNTAX_KINDS_TEMPLATE: &str = "../ra_syntax/src/syntax_kinds/generated.rs.tera"; | ||
9 | const AST: &str = "../ra_syntax/src/ast/generated.rs"; | ||
10 | const AST_TEMPLATE: &str = "../ra_syntax/src/ast/generated.rs.tera"; | ||
11 | |||
12 | #[test] | ||
13 | fn verify_template_generation() { | ||
14 | update(Path::new(SYNTAX_KINDS), &render_template(SYNTAX_KINDS_TEMPLATE, GRAMMAR).unwrap(), true).unwrap(); | ||
15 | update(Path::new(AST), &render_template(AST_TEMPLATE, GRAMMAR).unwrap(), true).unwrap(); | ||
16 | } \ No newline at end of file | ||