From 1121af3dd03bb000b935036232b11ae4f284195e Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 17 Feb 2017 14:34:24 +0100 Subject: Split comparison tests from other operators --- testing/tests/operators.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'testing/tests/operators.rs') diff --git a/testing/tests/operators.rs b/testing/tests/operators.rs index 240fd52..d58492e 100644 --- a/testing/tests/operators.rs +++ b/testing/tests/operators.rs @@ -4,6 +4,21 @@ extern crate askama_derive; use askama::Template; +#[derive(Template)] +#[template(path = "compare.html")] +struct CompareTemplate { + a: usize, + b: usize, + c: usize, +} + +#[test] +fn test_compare() { + let t = CompareTemplate { a: 1, b: 1, c: 2 }; + assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\n"); +} + + #[derive(Template)] #[template(path = "operators.html")] struct OperatorsTemplate { @@ -15,5 +30,5 @@ struct OperatorsTemplate { #[test] fn test_operators() { let t = OperatorsTemplate { a: 1, b: 1, c: 2 }; - assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\nmul\ndiv\nmod\n"); + assert_eq!(t.render(), "muldivmod"); } -- cgit