diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
index a14810572..d7281c4a8 100644
|
a
|
b
|
public final class Functions {
|
| 1175 | 1175 | public static boolean at(Environment env, double lat, double lon) { // NO_UCD (unused code) |
| 1176 | 1176 | return new LatLon(lat, lon).equalsEpsilon(center(env)); |
| 1177 | 1177 | } |
| | 1178 | |
| | 1179 | /** |
| | 1180 | * Test wheather the list {@code lst} contains the {@code str} element. |
| | 1181 | * @param str String |
| | 1182 | * @param lst list |
| | 1183 | * @return true if {@code str} is contained |
| | 1184 | * @since xxx |
| | 1185 | */ |
| | 1186 | public static boolean contains(String str, List<?> lst) { // NO_UCD (unused code) |
| | 1187 | for (int i = 0; i < lst.size(); i++) { |
| | 1188 | if (lst.get(i).equals(str)) { |
| | 1189 | return true; |
| | 1190 | } |
| | 1191 | } |
| | 1192 | return false; |
| | 1193 | } |
| 1178 | 1194 | } |
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
index dbb6bdc84..6eb6ca2fb 100644
|
a
|
b
|
public class MapCSSParserTest {
|
| 612 | 612 | sheet.loadStyleSource(); |
| 613 | 613 | assertTrue(sheet.getErrors().toString(), sheet.getErrors().isEmpty()); |
| 614 | 614 | } |
| | 615 | |
| | 616 | @Test |
| | 617 | public void testListContains() throws Exception { |
| | 618 | Selector s1 = getParser("way[contains(\"x10\", split(\";\", tag(\"ref\")))]").selector(); |
| | 619 | assertTrue(s1.matches(new Environment(OsmUtils.createPrimitive("way ref=x10;x20")))); |
| | 620 | assertFalse(s1.matches(new Environment(OsmUtils.createPrimitive("way ref=x20")))); |
| | 621 | assertFalse(s1.matches(new Environment(new Way()))); |
| | 622 | } |
| 615 | 623 | } |