Add extra optimization on And, add test

This commit is contained in:
Pieter Vander Vennet 2022-05-01 04:16:17 +02:00
parent 2f3886d2e0
commit 819f65e18d
3 changed files with 97 additions and 55 deletions

View file

@ -30,6 +30,12 @@ describe("Tag optimalization", () => {
const opt = t.optimize()
expect(opt).eq(true)
})
it("should return false on conflicting tags", () => {
const t = new And([new Tag("key","a"), new Tag("key","b")])
const opt = t.optimize()
expect(opt).eq(false)
})
it("with nested ors and common property should be extracted", () => {