use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class NotContainedFilterTest method stdElement.
private Element stdElement() {
Element el1 = new Way(1);
el1.addTag("ref", "x;y;z");
return el1;
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class ValueBuilderTest method testMultiSubst.
@Test
public void testMultiSubst() {
ValueBuilder vb = new ValueBuilder("${name|subst:abc=>xyz|subst:def=>www|def:unset}");
Element el = new Way(1);
// No tags set, so default value will be applied.
String s = vb.build(el, null);
assertEquals("name not set, so default is applied", "unset", s);
// Name tag is set, so substitutions are made
el.addTag("name", "abc def");
s = vb.build(el, null);
assertEquals("substitutions in name", "xyz www", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class ValueBuilderTest method testEmptyArg.
@Test
public void testEmptyArg() {
ValueBuilder vb = new ValueBuilder("${name|def:}");
Element el = new Way(1);
String s = vb.build(el, null);
assertEquals("", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class ValueBuilderTest method testDQuotedArg.
@Test
public void testDQuotedArg() {
ValueBuilder vb = new ValueBuilder("${name|subst:\"abc=>x y z \"}!");
Element el = new Way(1);
el.addTag("name", "Tabc");
String s = vb.build(el, null);
assertEquals("Tx y z !", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class ValueBuilderTest method testEmptyQuotedArg.
@Test
public void testEmptyQuotedArg() {
ValueBuilder vb = new ValueBuilder("${name|def:''}");
Element el = new Way(1);
String s = vb.build(el, null);
assertEquals("", s);
}
Aggregations