aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/templates/attr.html1
-rw-r--r--testing/tests/simple.rs17
2 files changed, 18 insertions, 0 deletions
diff --git a/testing/templates/attr.html b/testing/templates/attr.html
new file mode 100644
index 0000000..5c00baa
--- /dev/null
+++ b/testing/templates/attr.html
@@ -0,0 +1 @@
+{{ inner.a }}
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index 2aa93ea..00acda5 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -90,3 +90,20 @@ fn test_literals() {
let s = LiteralsTemplate {};
assert_eq!(s.render(), "a\n");
}
+
+
+struct Holder {
+ a: usize,
+}
+
+#[derive(Template)]
+#[template(path = "attr.html")]
+struct AttrTemplate {
+ inner: Holder,
+}
+
+#[test]
+fn test_attr() {
+ let t = AttrTemplate { inner: Holder { a: 5 } };
+ assert_eq!(t.render(), "5\n");
+}