From cece25b0be1f09f6ab9d53d099bb244858928f57 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 10 Aug 2017 07:38:00 +0200 Subject: Implement Display for all Templates --- testing/tests/simple.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testing/tests/simple.rs') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index b9b7a7c..896e082 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -154,3 +154,16 @@ fn test_json() { let t = JsonTemplate { foo: "a", bar: "b" }; assert_eq!(t.render().unwrap(), "{\"foo\": \"a\", \"bar\": \"b\"}"); } + + +#[derive(Template)] +#[template(path = "composition.html")] +struct CompositionTemplate { + foo: IfTemplate, +} + +#[test] +fn test_composition() { + let t = CompositionTemplate { foo: IfTemplate { cond: true } }; + assert_eq!(t.render().unwrap(), "composed: true"); +} -- cgit