diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-02 20:59:30 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-02 20:59:30 +0200 |
commit | 8ff2e316c07b4fd4373dd8a0bb5747bef3372a32 (patch) | |
tree | 5147b0be34fc45641d5e296c3020e91e6fec6f42 /testing | |
parent | 91fe53d9b5db7ace5f82889a174ef5061a049771 (diff) | |
parent | ce84543b69b69ab2030ce4daeae3f26d5008b11d (diff) | |
download | askama-8ff2e316c07b4fd4373dd8a0bb5747bef3372a32.tar.gz askama-8ff2e316c07b4fd4373dd8a0bb5747bef3372a32.tar.bz2 askama-8ff2e316c07b4fd4373dd8a0bb5747bef3372a32.zip |
Merge changes
Diffstat (limited to 'testing')
-rw-r--r-- | testing/templates/nested-attr.html | 1 | ||||
-rw-r--r-- | testing/tests/simple.rs | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/testing/templates/nested-attr.html b/testing/templates/nested-attr.html new file mode 100644 index 0000000..3bbbbc3 --- /dev/null +++ b/testing/templates/nested-attr.html @@ -0,0 +1 @@ +{{ inner.holder.a }} diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 6d8afa3..c924e85 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -93,6 +93,25 @@ fn test_attr() { } +struct NestedHolder { + holder: Holder, +} + +#[derive(Template)] +#[template(path = "nested-attr.html")] +struct NestedAttrTemplate { + inner: NestedHolder, +} + +#[test] +fn test_nested_attr() { + let t = NestedAttrTemplate { + inner: NestedHolder { holder: Holder { a: 5 } } + }; + assert_eq!(t.render(), "5"); +} + + #[derive(Template)] #[template(path = "option.html")] struct OptionTemplate<'a> { |