From e449140e0a635453084b502baf22f08e8750d068 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 18 Feb 2017 13:16:05 +0100 Subject: Add test for attribute support --- testing/tests/simple.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'testing/tests/simple.rs') 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"); +} -- cgit