mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: add missing not equals operators
Implement "!=" and "!==" operator support in QWeb.
This commit is contained in:
committed by
Géry Debongnie
parent
ee63f6bb0f
commit
e838e879c0
@@ -82,7 +82,7 @@ const STATIC_TOKEN_MAP: { [key: string]: TKind } = {
|
|||||||
")": "RIGHT_PAREN"
|
")": "RIGHT_PAREN"
|
||||||
};
|
};
|
||||||
|
|
||||||
const OPERATORS = ".,===,==,+,!,||,&&,>=,>,<=,<,?,-,*,/,%".split(',');
|
const OPERATORS = ".,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%".split(',');
|
||||||
|
|
||||||
type Tokenizer = (expr: string) => Token | false;
|
type Tokenizer = (expr: string) => Token | false;
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,13 @@ describe("tokenizer", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("various operators", () => {
|
test("various operators", () => {
|
||||||
expect(tokenize(">= <= < >")).toEqual([
|
expect(tokenize(">= <= < > !== !=")).toEqual([
|
||||||
{ type: "OPERATOR", value: ">=" },
|
{ type: "OPERATOR", value: ">=" },
|
||||||
{ type: "OPERATOR", value: "<=" },
|
{ type: "OPERATOR", value: "<=" },
|
||||||
{ type: "OPERATOR", value: "<" },
|
{ type: "OPERATOR", value: "<" },
|
||||||
{ type: "OPERATOR", value: ">" },
|
{ type: "OPERATOR", value: ">" },
|
||||||
|
{ type: "OPERATOR", value: "!==" },
|
||||||
|
{ type: "OPERATOR", value: "!=" },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user