added not() expression

This commit is contained in:
zadam
2020-05-27 00:09:19 +02:00
parent dc2d5a0a79
commit 55b210d7c5
4 changed files with 32 additions and 1 deletions

View File

@@ -63,4 +63,9 @@ describe("Lexer expression", () => {
expect(lexer(`# ~author.title = 'Hugh Howey' AND note.'book title' = 'Silo'`).expressionTokens)
.toEqual(["#", "~author", ".", "title", "=", "hugh howey", "and", "note", ".", "book title", "=", "silo"]);
});
it("negation of sub-expression", () => {
expect(lexer(`# not(#capital) and note.noteId != "root"`).expressionTokens)
.toEqual(["#", "not", "(", "#capital", ")", "and", "note", ".", "noteid", "!=", "root"]);
});
});