diff options
Diffstat (limited to 'testing')
-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"); +} |