From ca5bfc111616ac29eb18165d60bf309c2f18f419 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 13 Feb 2017 22:00:35 +0100 Subject: Implement support for mul, div, mod operators --- testing/templates/operators.html | 9 +++++++++ testing/tests/operators.rs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'testing') 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"); } -- cgit