diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-01-07 21:04:03 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-01-07 21:04:03 +0100 |
commit | 73a048459da99270b3a35672cf64c77db706a226 (patch) | |
tree | a7ea46aed4de9623e14f1c1b3a4d0cd42d7b1bc8 /testing | |
parent | ce9747c39c7523fbefe3700fbba93a6ac0c5341a (diff) | |
download | askama-73a048459da99270b3a35672cf64c77db706a226.tar.gz askama-73a048459da99270b3a35672cf64c77db706a226.tar.bz2 askama-73a048459da99270b3a35672cf64c77db706a226.zip |
Add test for simple if-blocks
Diffstat (limited to '')
-rw-r--r-- | testing/templates/if.html | 1 | ||||
-rw-r--r-- | testing/tests/simple.rs | 13 |
2 files changed, 14 insertions, 0 deletions
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"); +} |