use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method testNonDefaultDelimiterNotContained.
@Test
public void testNonDefaultDelimiterNotContained() {
NotContainedFilter filter = new NotContainedFilter("#:ref");
Element el = stdElement();
String s = filter.doFilter("x", el);
assertEquals(s, "x");
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method testNonDefaultDelimiterContained.
@Test
public void testNonDefaultDelimiterContained() {
NotContainedFilter filter = new NotContainedFilter("#:test");
Element el = stdElement();
el.addTag("test", "Aa#Bb#Cc#Dd");
String s = filter.doFilter("Cc", el);
assertNull(s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method test2ndArgContained.
@Test
public void test2ndArgContained() {
NotContainedFilter filter = new NotContainedFilter(":ref");
Element el = stdElement();
String s = filter.doFilter("x", el);
assertNull(s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element 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.Element 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);
}
Aggregations