mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-01 06:51:15 +00:00
Add tests for more binary operators
This commit is contained in:
parent
3003e58658
commit
b84a1242c4
@ -7,3 +7,27 @@
|
|||||||
{% if a % c == b -%}
|
{% if a % c == b -%}
|
||||||
mod
|
mod
|
||||||
{%- endif -%}
|
{%- 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 -%}
|
||||||
|
@ -30,5 +30,5 @@ struct OperatorsTemplate {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_operators() {
|
fn test_operators() {
|
||||||
let t = OperatorsTemplate { a: 1, b: 1, c: 2 };
|
let t = OperatorsTemplate { a: 1, b: 1, c: 2 };
|
||||||
assert_eq!(t.render(), "muldivmod");
|
assert_eq!(t.render(), "muldivmodaddrshlshbandbxorborandor");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user