From 114e9a2d74f1fa43c3418f8cd978fd4186fcb78b Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Sun, 14 Oct 2018 20:32:57 +0600 Subject: create cli.rs and make the tests passing --- crates/tools/tests/cli.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 crates/tools/tests/cli.rs (limited to 'crates/tools/tests') 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 @@ +extern crate tools; + +use std::path::Path; +use tools::{render_template, update}; + +const GRAMMAR: &str = "../ra_syntax/src/grammar.ron"; +const SYNTAX_KINDS: &str = "../ra_syntax/src/syntax_kinds/generated.rs"; +const SYNTAX_KINDS_TEMPLATE: &str = "../ra_syntax/src/syntax_kinds/generated.rs.tera"; +const AST: &str = "../ra_syntax/src/ast/generated.rs"; +const AST_TEMPLATE: &str = "../ra_syntax/src/ast/generated.rs.tera"; + +#[test] +fn verify_template_generation() { + update(Path::new(SYNTAX_KINDS), &render_template(SYNTAX_KINDS_TEMPLATE, GRAMMAR).unwrap(), true).unwrap(); + update(Path::new(AST), &render_template(AST_TEMPLATE, GRAMMAR).unwrap(), true).unwrap(); +} \ No newline at end of file -- cgit v1.2.3