From 73a048459da99270b3a35672cf64c77db706a226 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 7 Jan 2017 21:04:03 +0100 Subject: Add test for simple if-blocks --- testing/templates/if.html | 1 + testing/tests/simple.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 testing/templates/if.html diff --git a/testing/templates/if.html b/testing/templates/if.html new file mode 100644 index 0000000..0b9cda1 --- /dev/null +++ b/testing/templates/if.html @@ -0,0 +1 @@ +{% if cond %}true{% endif %} diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index c287c5f..d17cae3 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -26,3 +26,16 @@ fn test_variables() { Iñtërnâtiônàlizætiøn is important\n\ in vars too: Iñtërnâtiônàlizætiøn\n"); } + + +#[derive(Template)] +#[template(path = "if.html")] +struct IfTemplate { + cond: bool, +} + +#[test] +fn test_if() { + let s = IfTemplate { cond: true }; + assert_eq!(s.render(), "true\n"); +} -- cgit