diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-08 19:55:47 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-08 19:55:47 +0100 |
commit | f71b2f03230fe8a6f50c3a02dcfeaed920fbdca3 (patch) | |
tree | 84263883f05fdcc739bc7c35b904c90d4849c303 /testing | |
parent | c927d51fe10a2050e0afd143e300615facd781b7 (diff) | |
download | askama-f71b2f03230fe8a6f50c3a02dcfeaed920fbdca3.tar.gz askama-f71b2f03230fe8a6f50c3a02dcfeaed920fbdca3.tar.bz2 askama-f71b2f03230fe8a6f50c3a02dcfeaed920fbdca3.zip |
Add test for type parameters and where clauses (see #9)
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/simple.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 45bc0ff..8115fe0 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -106,3 +106,17 @@ fn test_option() { let none = OptionTemplate { var: None }; assert_eq!(none.render(), "none"); } + + +#[derive(Template)] +#[template(path = "generics.html")] +struct GenericsTemplate<T: std::fmt::Display, U> where U: std::fmt::Display { + t: T, + u: U, +} + +#[test] +fn test_generics() { + let t = GenericsTemplate { t: "a", u: 42 }; + assert_eq!(t.render(), "a42"); +} |