Changeset 14484 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2018-12-02T02:32:13+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #17058 - Cannot add assertMatch/assertNoMatch declarations with inside() selector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java

    r14481 r14484  
    5252    @Rule
    5353    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    54     public JOSMTestRules test = new JOSMTestRules().projection();
     54    public JOSMTestRules test = new JOSMTestRules().projection().territories();
    5555
    5656    static MapCSSTagChecker buildTagChecker(String css) throws ParseException {
     
    191191
    192192    /**
     193     * Checks that assertions work for country-specific checks.
     194     * @throws ParseException if a parsing error occurs
     195     */
     196    @Test
     197    public void testAssertInsideCountry() throws ParseException {
     198        final MapCSSTagChecker test = buildTagChecker(
     199                "node[amenity=parking][inside(\"BR\")] {\n" +
     200                "  throwWarning: \"foo\";\n" +
     201                "  assertMatch: \"node amenity=parking\";\n" +
     202                "  assertNoMatch: \"node amenity=restaurant\";\n" +
     203                "}");
     204        Set<String> errors = test.checkAsserts(test.checks.get("test"));
     205        assertTrue(errors.toString(), errors.isEmpty());
     206    }
     207
     208    /**
    193209     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13762">Bug #13762</a>.
    194210     * @throws ParseException if a parsing error occurs
Note: See TracChangeset for help on using the changeset viewer.