diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/templates/comparison.html | 6 | ||||
-rw-r--r-- | testing/templates/eq.html | 1 | ||||
-rw-r--r-- | testing/tests/comparison.rs | 10 |
3 files changed, 11 insertions, 6 deletions
diff --git a/testing/templates/comparison.html b/testing/templates/comparison.html new file mode 100644 index 0000000..87aaec3 --- /dev/null +++ b/testing/templates/comparison.html @@ -0,0 +1,6 @@ +{% if a == b %}t{% endif %}{% if a == c %}t{% else %}f{% endif %} +{% if a != c %}t{% endif %}{% if a != b %}t{% else %}f{% endif %} +{% if c >= b %}t{% endif %}{% if b >= c %}t{% else %}f{% endif %} +{% if c > b %}t{% endif %}{% if a > c %}t{% else %}f{% endif %} +{% if a <= b %}t{% endif %}{% if c <= b %}t{% else %}f{% endif %} +{% if a < c %}t{% endif %}{% if a < b %}t{% else %}f{% endif %} diff --git a/testing/templates/eq.html b/testing/templates/eq.html deleted file mode 100644 index 44666d3..0000000 --- a/testing/templates/eq.html +++ /dev/null @@ -1 +0,0 @@ -{% if a == b %}t{% endif %}{% if a == c %}t{% else %}f{% endif %} diff --git a/testing/tests/comparison.rs b/testing/tests/comparison.rs index 2e34bc0..20214a0 100644 --- a/testing/tests/comparison.rs +++ b/testing/tests/comparison.rs @@ -5,15 +5,15 @@ extern crate askama_derive; use askama::Template; #[derive(Template)] -#[template(path = "eq.html")] -struct EqTemplate { +#[template(path = "comparison.html")] +struct ComparisonTemplate { a: usize, b: usize, c: usize, } #[test] -fn test_eq() { - let t = EqTemplate { a: 1, b: 1, c: 2 }; - assert_eq!(t.render(), "tf\n"); +fn test_comparison() { + let t = ComparisonTemplate { a: 1, b: 1, c: 2 }; + assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\n"); } |