Changeset 17601 in josm


Ignore:
Timestamp:
2021-03-20T14:00:16+01:00 (3 years ago)
Author:
simon04
Message:

see #20613 - Fix MapCSSParserTest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java

    r17586 r17601  
    1414import java.util.Arrays;
    1515import java.util.List;
     16import java.util.regex.Pattern;
    1617
    1718import org.junit.Assert;
     
    3132import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyCondition;
    3233import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyMatchType;
     34import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyRegexpCondition;
    3335import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition;
    3436import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op;
     
    219221    @Test
    220222    void testRegexKeyCondition() throws Exception {
    221         KeyCondition c1 = (KeyCondition) getParser("[/.*:(backward|forward)$/]").condition(PRIMITIVE);
    222         assertEquals(KeyMatchType.REGEX, c1.matchType);
     223        KeyRegexpCondition c1 = (KeyRegexpCondition) getParser("[/.*:(backward|forward)$/]").condition(PRIMITIVE);
     224        assertEquals(Pattern.compile(".*:(backward|forward)$"), ((KeyRegexpCondition) c1).pattern);
    223225        assertFalse(c1.applies(getEnvironment("lanes", "3")));
    224226        assertTrue(c1.applies(getEnvironment("lanes:forward", "3")));
Note: See TracChangeset for help on using the changeset viewer.