use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testVariable.
@Test
public void testVariable() {
ValueBuilder vb = new ValueBuilder("${name} road");
Element el = new Way(1);
el.addTag("name", "abc abc");
String s = vb.build(el, null);
assertEquals("abc abc road", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testSpacedArgsOldSyntax.
/**
* Test that you can use a space before the pipe with the old unquoted syntax.
*/
@Test
public void testSpacedArgsOldSyntax() {
ValueBuilder vb = new ValueBuilder("{ name '${rcnname | substring:1:14}' }");
Element el = new Way(1);
el.addTag("rcnname", "1234567890123456789");
String s = vb.build(el, null);
assertEquals("value is trimmed", "{ name '2345678901234' }", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testQuotedSplitLines.
@Test
public void testQuotedSplitLines() {
String value = "${cs:phone|subst:^00~>+|subst:[-\n" + "()]~>|subst:^0~>+353|subst:^+3530~>+353}";
ValueBuilder vb = new ValueBuilder(value);
Element el = new Way(1);
el.addTag("mkgmap:country", "IRL");
el.addTag("cs:phone", "00(22)5554-444");
String s = vb.build(el, null);
assertEquals("+225554444", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testSimpleSubst.
@Test
public void testSimpleSubst() {
ValueBuilder vb = new ValueBuilder("init ${name|subst:abc=>xyz} final");
Element el = new Way(1);
el.addTag("name", "abc road abc");
String s = vb.build(el, null);
assertEquals("init xyz road xyz final", s);
}
Aggregations