aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-13 22:00:35 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-13 22:00:35 +0100
commitca5bfc111616ac29eb18165d60bf309c2f18f419 (patch)
treef57e85c5ffc2b1e0856ed827583d9b7978e6bd9e /testing
parenta6b4f305e948cdf327b45abe52b27a4d81013d5d (diff)
downloadaskama-ca5bfc111616ac29eb18165d60bf309c2f18f419.tar.gz
askama-ca5bfc111616ac29eb18165d60bf309c2f18f419.tar.bz2
askama-ca5bfc111616ac29eb18165d60bf309c2f18f419.zip
Implement support for mul, div, mod operators
Diffstat (limited to 'testing')
-rw-r--r--testing/templates/operators.html9
-rw-r--r--testing/tests/operators.rs2
2 files changed, 10 insertions, 1 deletions
diff --git a/testing/templates/operators.html b/testing/templates/operators.html
index ea22546..020126b 100644
--- a/testing/templates/operators.html
+++ b/testing/templates/operators.html
@@ -46,3 +46,12 @@
{%- else -%}
f
{%- endif %}
+{% if a * c > b -%}
+ mul
+{%- endif %}
+{% if c / c == a -%}
+ div
+{%- endif %}
+{% if a % c == b -%}
+ mod
+{%- endif %}
diff --git a/testing/tests/operators.rs b/testing/tests/operators.rs
index 0154118..240fd52 100644
--- a/testing/tests/operators.rs
+++ b/testing/tests/operators.rs
@@ -15,5 +15,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\n");
+ assert_eq!(t.render(), "tf\ntf\ntf\ntf\ntf\ntf\nmul\ndiv\nmod\n");
}