diff options
author | larros <larserik.rosengren@gmail.com> | 2017-09-26 10:02:44 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-26 10:02:44 +0200 |
commit | df58dcb49db77b2c283db3c9a8a738bdff3a8e37 (patch) | |
tree | 0de4a117d1e97216381b8336a1cec826e894d075 /testing/tests/macro.rs | |
parent | 4e919e47539b5fa346f1cac323ab250558b834bc (diff) | |
download | askama-df58dcb49db77b2c283db3c9a8a738bdff3a8e37.tar.gz askama-df58dcb49db77b2c283db3c9a8a738bdff3a8e37.tar.bz2 askama-df58dcb49db77b2c283db3c9a8a738bdff3a8e37.zip |
Add support for importing template files with macros (#51)
* Fix review comments for macro imports
Diffstat (limited to 'testing/tests/macro.rs')
-rw-r--r-- | testing/tests/macro.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tests/macro.rs b/testing/tests/macro.rs index 72f578e..25d95d8 100644 --- a/testing/tests/macro.rs +++ b/testing/tests/macro.rs @@ -14,3 +14,15 @@ fn test_macro() { let t = MacroTemplate { s: "foo" }; assert_eq!(t.render().unwrap(), "foo foo foo"); } + +#[derive(Template)] +#[template(path = "import.html")] +struct ImportTemplate<'a> { + s: &'a str, +} + +#[test] +fn test_import() { + let t = ImportTemplate { s: "foo" }; + assert_eq!(t.render().unwrap(), "foo foo foo"); +} |