diff options
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/simple.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index d17cae3..6515146 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -39,3 +39,16 @@ fn test_if() { let s = IfTemplate { cond: true }; assert_eq!(s.render(), "true\n"); } + + +#[derive(Template)] +#[template(path = "else.html")] +struct ElseTemplate { + cond: bool, +} + +#[test] +fn test_else() { + let s = ElseTemplate { cond: false }; + assert_eq!(s.render(), "false\n"); +} |