More work on the theme generator

This commit is contained in:
Pieter Vander Vennet 2020-08-23 01:49:19 +02:00
parent cd37d8db98
commit 0f433d026a
13 changed files with 340 additions and 87 deletions

View file

@ -11,13 +11,19 @@ import T from "./TestHelper";
new T([
["Parse and match advanced tagging", () => {
const tags = CustomLayoutFromJSON.TagsFromJson("indoor=yes&access!=private");
console.log(tags);
const m0 = new And(tags).matches([{k: "indoor", v: "yes"}, {k: "access", v: "yes"}]);
equal(m0, true);
const m1 = new And(tags).matches([{k: "indoor", v: "yes"}, {k: "access", v: "private"}]);
equal(m1, false);
}
],
["Parse tagging with regex", () => {
const tags = CustomLayoutFromJSON.TagsFromJson("highway~=residential|tertiary");
equal(""+tags[0].value, ""+/residential|tertiary/);
console.log(tags[0].asOverpass());
}
],
["Tag replacement works in translation", () => {
const tr = new Translation({
"en": "Test {key} abc"