diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-17 14:59:04 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-17 14:59:04 +0100 |
commit | b84a1242c449efaf23c50d7389e9c5cc3b8e9ded (patch) | |
tree | 3e854bf0acacae4ec3ffcdd8243bbdf9f800fc4f | |
parent | 3003e5865801d912c075fc0c04412a8a65956d96 (diff) | |
download | askama-b84a1242c449efaf23c50d7389e9c5cc3b8e9ded.tar.gz askama-b84a1242c449efaf23c50d7389e9c5cc3b8e9ded.tar.bz2 askama-b84a1242c449efaf23c50d7389e9c5cc3b8e9ded.zip |
Add tests for more binary operators
-rw-r--r-- | testing/templates/operators.html | 24 | ||||
-rw-r--r-- | testing/tests/operators.rs | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/testing/templates/operators.html b/testing/templates/operators.html index 750f0aa..1488b9a 100644 --- a/testing/templates/operators.html +++ b/testing/templates/operators.html @@ -7,3 +7,27 @@ {% if a % c == b -%} mod {%- endif -%} +{% if a + b == c -%} + add +{%- endif -%} +{% if a << b == c -%} + rsh +{%- endif -%} +{% if c >> b == a -%} + lsh +{%- endif -%} +{% if a & b == b -%} + band +{%- endif -%} +{% if b ^ c == a + c -%} + bxor +{%- endif -%} +{% if b | c == a + c -%} + bor +{%- endif -%} +{% if a == b && a + b == c -%} + and +{%- endif -%} +{% if a == c || a == b -%} + or +{%- endif -%} diff --git a/testing/tests/operators.rs b/testing/tests/operators.rs index d58492e..73745f0 100644 --- a/testing/tests/operators.rs +++ b/testing/tests/operators.rs @@ -30,5 +30,5 @@ struct OperatorsTemplate { #[test] fn test_operators() { let t = OperatorsTemplate { a: 1, b: 1, c: 2 }; - assert_eq!(t.render(), "muldivmod"); + assert_eq!(t.render(), "muldivmodaddrshlshbandbxorborandor"); } |