aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/inheritance.rs
diff options
context:
space:
mode:
authorLibravatar Guillaume Gomez <guillaume1.gomez@gmail.com>2023-10-23 13:32:37 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-10-23 15:13:27 +0200
commita7f5186bf49ef20010c2eae7717b3a738a3b548e (patch)
treedcc1d87b4ba2b916706739f85e505062cb73303d /testing/tests/inheritance.rs
parent5ee2dfbe6bf901c7c731e9b94ba92b82f09e9101 (diff)
downloadaskama-a7f5186bf49ef20010c2eae7717b3a738a3b548e.tar.gz
askama-a7f5186bf49ef20010c2eae7717b3a738a3b548e.tar.bz2
askama-a7f5186bf49ef20010c2eae7717b3a738a3b548e.zip
Add test specifically for named blocks, and named macros
Diffstat (limited to '')
-rw-r--r--testing/tests/inheritance.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs
index 5d8aefb..906be04 100644
--- a/testing/tests/inheritance.rs
+++ b/testing/tests/inheritance.rs
@@ -340,3 +340,15 @@ fn test_let_block() {
let t = LetChild {};
assert_eq!(t.render().unwrap(), "1");
}
+
+#[derive(Template)]
+#[template(path = "named-end.html")]
+struct NamedBlocks<'a> {
+ title: &'a str,
+}
+
+#[test]
+fn test_named_end() {
+ let n = NamedBlocks { title: "title" };
+ assert_eq!(n.render().unwrap(), "title\n\ntadam\nCopyright 2017");
+}