Changeset 17800 in josm for trunk/test


Ignore:
Timestamp:
2021-04-19T21:45:11+02:00 (2 months ago)
Author:
simon04
Message:

see #20745 - Avoid heap allocations via Selector.AbstractSelector#conds

File:
1 edited

Legend:

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

    r17780 r17800  
    7979    @Test
    8080    void testClassCondition() throws Exception {
    81         List<Condition> conditions = ((Selector.GeneralSelector) getParser("way[name=X].highway:closed").selector()).conds;
     81        List<Condition> conditions = getParser("way[name=X].highway:closed").selector().getConditions();
    8282        assertTrue(conditions.get(0) instanceof SimpleKeyValueCondition);
    8383        assertTrue(conditions.get(0).applies(getEnvironment("name", "X")));
     
    8989    @Test
    9090    void testPseudoClassCondition() throws Exception {
    91         Condition c0 = ((Selector.GeneralSelector) getParser("way:area-style").selector()).conds.get(0);
    92         Condition c1 = ((Selector.GeneralSelector) getParser("way!:area-style").selector()).conds.get(0);
    93         Condition c2 = ((Selector.GeneralSelector) getParser("way!:areaStyle").selector()).conds.get(0);
    94         Condition c3 = ((Selector.GeneralSelector) getParser("way!:area_style").selector()).conds.get(0);
     91        Condition c0 = getParser("way:area-style").selector().getConditions().get(0);
     92        Condition c1 = getParser("way!:area-style").selector().getConditions().get(0);
     93        Condition c2 = getParser("way!:areaStyle").selector().getConditions().get(0);
     94        Condition c3 = getParser("way!:area_style").selector().getConditions().get(0);
    9595        assertEquals(":areaStyle", c0.toString());
    9696        assertEquals("!:areaStyle", c1.toString());
Note: See TracChangeset for help on using the changeset viewer.