[IMP] compiler: add support for binary operators

This commit is contained in:
Géry Debongnie
2022-06-24 15:25:47 +02:00
committed by aab-odoo
parent c7459ef87b
commit 7f580a4e1d
2 changed files with 9 additions and 3 deletions
@@ -221,4 +221,11 @@ describe("expression evaluation", () => {
expect(compileExpr("a.c in b")).toBe("ctx['a'].c in ctx['b']");
expect(compileExpr("typeof val")).toBe("typeof ctx['val']");
});
test("binary operators", () => {
expect(compileExpr("1 | 1")).toBe("1|1");
expect(compileExpr("1 & 1")).toBe("1&1");
expect(compileExpr("1 ^ 1")).toBe("1^1");
expect(compileExpr("~1")).toBe("~1");
});
});