Changeset 14540 in josm


Ignore:
Timestamp:
2018-12-09T23:29:52+01:00 (3 months ago)
Author:
Don-vip
Message:

fix #17058 - support assertions with several countries

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r14489 r14540  
    993993                .map(e -> ((LiteralExpression) e).getLiteral())
    994994                .filter(l -> l instanceof String)
    995                 .map(l -> (String) l)
     995                .map(l -> ((String) l).split(",")[0])
    996996                .findFirst();
    997997    }
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java

    r14484 r14540  
    207207
    208208    /**
     209     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17058">Bug #17058</a>.
     210     * @throws ParseException if a parsing error occurs
     211     */
     212    @Test
     213    public void testTicket17058() throws ParseException {
     214        final MapCSSTagChecker test = buildTagChecker(
     215                "*[name =~ /(?i).*Straße.*/][inside(\"LI,CH\")] {\n" +
     216                "  throwError: tr(\"street name contains ß\");\n" +
     217                "  assertMatch: \"way name=Hauptstraße\";\n" +
     218                "  assertNoMatch: \"way name=Hauptstrasse\";\n" +
     219                "}");
     220        Set<String> errors = test.checkAsserts(test.checks.get("test"));
     221        assertTrue(errors.toString(), errors.isEmpty());
     222    }
     223
     224    /**
    209225     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13762">Bug #13762</a>.
    210226     * @throws ParseException if a parsing error occurs
Note: See TracChangeset for help on using the changeset viewer.