forked from MapComplete/MapComplete
Tests: add regression test for regex
This commit is contained in:
parent
84cbd2fbc0
commit
418e52575a
1 changed files with 12 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { TagUtils } from "../../../Logic/Tags/TagUtils"
|
import {TagUtils} from "../../../Logic/Tags/TagUtils"
|
||||||
import { equal } from "assert"
|
import {equal} from "assert"
|
||||||
import { describe, expect, it } from "vitest"
|
import {describe, expect, it} from "vitest"
|
||||||
|
|
||||||
describe("TagUtils", () => {
|
describe("TagUtils", () => {
|
||||||
describe("ParseTag", () => {
|
describe("ParseTag", () => {
|
||||||
|
@ -45,4 +45,13 @@ describe("TagUtils", () => {
|
||||||
expect(filter.matchesProperties({ date_created: "2022-01-01" })).toBe(true)
|
expect(filter.matchesProperties({ date_created: "2022-01-01" })).toBe(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
describe("regextag", () => {
|
||||||
|
it("should match tags", () => {
|
||||||
|
const t = TagUtils.Tag( "_tags~(^|.*;)leisure=picnic_table($|;.*)")
|
||||||
|
const properties = {
|
||||||
|
_tags: 'leisure=picnic_table'
|
||||||
|
}
|
||||||
|
expect(t.matchesProperties(properties)).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue