aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/tests
diff options
context:
space:
mode:
authorMuhammad Mominul Huque <[email protected]>2018-10-14 15:32:57 +0100
committerMuhammad Mominul Huque <[email protected]>2018-10-14 15:32:57 +0100
commit114e9a2d74f1fa43c3418f8cd978fd4186fcb78b (patch)
tree922ec7c131d19594b37c0185f894a696f3e577e7 /crates/tools/tests
parent2ba6f18586d02a6dbc32e0bea88f7b4236277ea1 (diff)
create cli.rs and make the tests passing
Diffstat (limited to 'crates/tools/tests')
-rw-r--r--crates/tools/tests/cli.rs16
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 @@
1extern crate tools;
2
3use std::path::Path;
4use tools::{render_template, update};
5
6const GRAMMAR: &str = "../ra_syntax/src/grammar.ron";
7const SYNTAX_KINDS: &str = "../ra_syntax/src/syntax_kinds/generated.rs";
8const SYNTAX_KINDS_TEMPLATE: &str = "../ra_syntax/src/syntax_kinds/generated.rs.tera";
9const AST: &str = "../ra_syntax/src/ast/generated.rs";
10const AST_TEMPLATE: &str = "../ra_syntax/src/ast/generated.rs.tera";
11
12#[test]
13fn 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