aboutsummaryrefslogtreecommitdiffstats
path: root/askama_test
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2016-12-22 13:49:53 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2016-12-22 14:16:05 +0100
commite619345766e98578929061e566178010c171df48 (patch)
tree844c71a6842608ca78a244bfd1caaf50cfc92c2e /askama_test
downloadaskama-e619345766e98578929061e566178010c171df48.tar.gz
askama-e619345766e98578929061e566178010c171df48.tar.bz2
askama-e619345766e98578929061e566178010c171df48.zip
Initial stab at macros 1.1
Diffstat (limited to '')
-rw-r--r--askama_test/Cargo.toml9
-rw-r--r--askama_test/tests/simple.rs18
2 files changed, 27 insertions, 0 deletions
diff --git a/askama_test/Cargo.toml b/askama_test/Cargo.toml
new file mode 100644
index 0000000..8d01793
--- /dev/null
+++ b/askama_test/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "askama_test"
+version = "0.1.0"
+authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"]
+workspace = ".."
+
+[dependencies]
+askama_codegen = { path = "../askama_codegen" }
+askama = { path = "../askama" }
diff --git a/askama_test/tests/simple.rs b/askama_test/tests/simple.rs
new file mode 100644
index 0000000..f7beb80
--- /dev/null
+++ b/askama_test/tests/simple.rs
@@ -0,0 +1,18 @@
+#![feature(proc_macro)]
+
+#[macro_use]
+extern crate askama_codegen;
+extern crate askama;
+
+use askama::Template;
+
+#[derive(Template)]
+struct TestTemplate {
+ var: String,
+}
+
+#[test]
+fn it_works() {
+ let s = TestTemplate { var: "foo".to_string() }.render();
+ assert_eq!(s, "hello world, foo");
+}