aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/inheritance.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/inheritance.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs
index 6e032ba..2fd69c6 100644
--- a/testing/tests/inheritance.rs
+++ b/testing/tests/inheritance.rs
@@ -23,14 +23,15 @@ fn test_use_base_directly() {
#[test]
fn test_simple_extends() {
- let t = ChildTemplate { _parent: BaseTemplate { title: "Bar" } };
+ let t = ChildTemplate {
+ _parent: BaseTemplate { title: "Bar" },
+ };
assert_eq!(
t.render().unwrap(),
"Bar\n(Bar) Content goes here\nFoo\nCopyright 2017"
);
}
-
pub mod parent {
use askama::Template;
#[derive(Template)]
@@ -41,8 +42,8 @@ pub mod parent {
}
pub mod child {
- use askama::Template;
use super::parent::*;
+ use askama::Template;
#[derive(Template)]
#[template(path = "child.html")]
pub struct ChildTemplate<'a> {
@@ -52,15 +53,15 @@ pub mod child {
#[test]
fn test_different_module() {
- let t = child::ChildTemplate { _parent: parent::BaseTemplate { title: "a" } };
+ let t = child::ChildTemplate {
+ _parent: parent::BaseTemplate { title: "a" },
+ };
assert_eq!(
t.render().unwrap(),
"a\n(a) Content goes here\nFoo\nCopyright 2017"
);
}
-
-
#[derive(Template)]
#[template(path = "nested-base.html")]
struct NestedBaseTemplate {}
@@ -73,6 +74,8 @@ struct NestedChildTemplate {
#[test]
fn test_nested_blocks() {
- let t = NestedChildTemplate { _parent: NestedBaseTemplate {} };
+ let t = NestedChildTemplate {
+ _parent: NestedBaseTemplate {},
+ };
assert_eq!(t.render().unwrap(), "\ndurpy\n");
}