use of uk.me.parabola.mkgmap.reader.osm.Element 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.Element 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);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testQuotedArgs.
@Test
public void testQuotedArgs() {
ValueBuilder vb = new ValueBuilder("${name|subst:'abc=>x|y'|subst:'defg=>w|w\"w'|def:'unset string' }");
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 string", s);
// Name tag is set, so substitutions are made
el.addTag("name", "abc defg");
s = vb.build(el, null);
assertEquals("substitutions in name", "x|y w|w\"w", s);
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testQuotedArg.
@Test
public void testQuotedArg() {
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.Element in project mkgmap by openstreetmap.
the class ValueBuilderTest method testTranslitAscii.
@Test
public void testTranslitAscii() {
ValueBuilder vb = new ValueBuilder("${name|ascii}");
Element el = new Way(1);
el.addTag("name", "frêd");
String s = vb.build(el, null);
assertEquals("fred", s);
}
Aggregations