forked from MapComplete/MapComplete
Improve optimizations
This commit is contained in:
parent
82b25bd2a6
commit
d98816212d
2 changed files with 14 additions and 6 deletions
|
@ -181,6 +181,16 @@ describe("Tag optimalization", () => {
|
|||
const q = new And([new Tag("key", "value"), new RegexTag("key", /value/, true)])
|
||||
expect(q.optimize()).toBe(false)
|
||||
})
|
||||
it("should optimize regexes in the key", () => {
|
||||
const spec = TagUtils.Tag({
|
||||
and: [
|
||||
"service:bicycle:retail=yes",
|
||||
"service:bicycle:.+~~yes"
|
||||
]
|
||||
})
|
||||
const tag = <TagsFilter> spec.optimize()
|
||||
expect(tag.asJson()).to.eq("service:bicycle:retail=yes")
|
||||
})
|
||||
})
|
||||
|
||||
describe("Or", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue