From a6b4f305e948cdf327b45abe52b27a4d81013d5d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 13 Feb 2017 21:55:47 +0100 Subject: Rename comparison tests to be about any operators --- testing/templates/comparison.html | 48 --------------------------------------- testing/templates/operators.html | 48 +++++++++++++++++++++++++++++++++++++++ testing/tests/comparison.rs | 19 ---------------- testing/tests/operators.rs | 19 ++++++++++++++++ 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 testing/templates/comparison.html create mode 100644 testing/templates/operators.html delete mode 100644 testing/tests/comparison.rs create mode 100644 testing/tests/operators.rs (limited to 'testing') diff --git a/testing/templates/comparison.html b/testing/templates/comparison.html deleted file mode 100644 index ea22546..0000000 --- a/testing/templates/comparison.html +++ /dev/null @@ -1,48 +0,0 @@ -{% 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/operators.html b/testing/templates/operators.html new file mode 100644 index 0000000..ea22546 --- /dev/null +++ b/testing/templates/operators.html @@ -0,0 +1,48 @@ +{% 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/tests/comparison.rs b/testing/tests/comparison.rs deleted file mode 100644 index 20214a0..0000000 --- a/testing/tests/comparison.rs +++ /dev/null @@ -1,19 +0,0 @@ -extern crate askama; -#[macro_use] -extern crate askama_derive; - -use askama::Template; - -#[derive(Template)] -#[template(path = "comparison.html")] -struct ComparisonTemplate { - a: usize, - b: usize, - c: usize, -} - -#[test] -fn test_comparison() { - let t = ComparisonTemplate { a: 1, b: 1, c: 2 }; - assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\n"); -} diff --git a/testing/tests/operators.rs b/testing/tests/operators.rs new file mode 100644 index 0000000..0154118 --- /dev/null +++ b/testing/tests/operators.rs @@ -0,0 +1,19 @@ +extern crate askama; +#[macro_use] +extern crate askama_derive; + +use askama::Template; + +#[derive(Template)] +#[template(path = "operators.html")] +struct OperatorsTemplate { + a: usize, + b: usize, + c: usize, +} + +#[test] +fn test_operators() { + let t = OperatorsTemplate { a: 1, b: 1, c: 2 }; + assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\n"); +} -- cgit