Ignore:
Timestamp:
2021-04-12T22:43:33+02:00 (3 years ago)
Author:
simon04
Message:

see #20744 - Evaluate MapCSS pseudo classes without array creation

File:
1 edited

Legend:

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

    r17275 r17762  
    1313import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1414import net.trajano.commons.testing.UtilityClassTestUtil;
     15
     16import java.lang.reflect.Method;
    1517
    1618/**
     
    4345        UtilityClassTestUtil.assertUtilityClassWellDefined(PseudoClasses.class);
    4446    }
     47
     48    /**
     49     * Tests that all functions have been registered to {@link ConditionFactory.PseudoClassCondition#CONDITION_MAP}
     50     */
     51    @Test
     52    void testAllPseudoClassesRegistered() {
     53        for (Method method : PseudoClasses.class.getDeclaredMethods()) {
     54            String name = method.getName().replaceFirst("^_new$", "new");
     55            Context context = name.equals("sameTags") ? Context.LINK : Context.PRIMITIVE;
     56            ConditionFactory.PseudoClassCondition.createPseudoClassCondition(name, false, context);
     57            ConditionFactory.PseudoClassCondition.createPseudoClassCondition(name, true, context);
     58        }
     59    }
    4560}
Note: See TracChangeset for help on using the changeset viewer.