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


Ignore:
Timestamp:
2014-05-12T23:07:55+02:00 (11 years ago)
Author:
simon04
Message:

fix #9783 - MapCSS: allow to regexp-match name=(foo) by [name =~ /\(foo\)/]

File:
1 edited

Legend:

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

    r7081 r7115  
    113113
    114114    @Test
     115    public void testRegexConditionParenthesis() throws Exception {
     116        def condition = (Condition.KeyValueCondition) getParser("[name =~ /^\\(foo\\)/]").condition(Condition.Context.PRIMITIVE)
     117        assert condition.applies(getEnvironment("name", "(foo)"))
     118        assert !condition.applies(getEnvironment("name", "foo"))
     119        assert !condition.applies(getEnvironment("name", "((foo))"))
     120    }
     121
     122    @Test
    115123    public void testNegatedRegexCondition() throws Exception {
    116124        def condition = (Condition.KeyValueCondition) getParser("[surface!~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE)
Note: See TracChangeset for help on using the changeset viewer.