From b84a1242c449efaf23c50d7389e9c5cc3b8e9ded Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 17 Feb 2017 14:59:04 +0100 Subject: Add tests for more binary operators --- testing/templates/operators.html | 24 ++++++++++++++++++++++++ testing/tests/operators.rs | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'testing') 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"); } -- cgit