From 549d0ec3c6799eb31517b093faa7c85752ba7d8c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 4 Aug 2017 13:19:31 +0200 Subject: Add test for include blocks (see #25) --- testing/tests/include.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 testing/tests/include.rs (limited to 'testing/tests/include.rs') diff --git a/testing/tests/include.rs b/testing/tests/include.rs new file mode 100644 index 0000000..7ddccd2 --- /dev/null +++ b/testing/tests/include.rs @@ -0,0 +1,19 @@ +#[macro_use] +extern crate askama; + +use askama::Template; + +#[derive(Template)] +#[template(path = "include.html")] +struct IncludeTemplate<'a> { + strs: &'a [&'a str], +} + +#[test] +fn test_include() { + let strs = vec!["foo", "bar"]; + let s = IncludeTemplate { + strs: &strs, + }; + assert_eq!(s.render(), "INCLUDED: fooINCLUDED: bar") +} -- cgit