diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-18 13:16:05 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-18 13:16:17 +0100 |
commit | e449140e0a635453084b502baf22f08e8750d068 (patch) | |
tree | fe8d7d03dc6320ba793e8bc6471d571631ab554d /testing/tests | |
parent | 9296d1303ed7baa88507e683c23319c75df341d8 (diff) | |
download | askama-e449140e0a635453084b502baf22f08e8750d068.tar.gz askama-e449140e0a635453084b502baf22f08e8750d068.tar.bz2 askama-e449140e0a635453084b502baf22f08e8750d068.zip |
Add test for attribute support
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/simple.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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"); +} |