diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 45bc0ffcd..8115fe00c 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 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"); +}