Changeset 9857 in josm for trunk/test


Ignore:
Timestamp:
2016-02-23T19:36:31+01:00 (4 years ago)
Author:
simon04
Message:

fix #12549 - MapCSS: permit using character classes in regexp: \p{...}

File:
1 edited

Legend:

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

    r8784 r9857  
    433433        assert mc.getCascade(Environment.DEFAULT_LAYER).get("max_split", -777f, Float.class) == 56
    434434    }
     435
     436    @Test
     437    public void testTicket12549() throws Exception {
     438        def condition = getParser("[name =~ /^(?i)(?u)fóo\$/]").condition(Condition.Context.PRIMITIVE)
     439        assert condition.applies(new Environment(OsmUtils.createPrimitive("way name=fóo")))
     440        assert condition.applies(new Environment(OsmUtils.createPrimitive("way name=fÓo")))
     441        condition = getParser("[name =~ /^(\\p{Lower})+\$/]").condition(Condition.Context.PRIMITIVE)
     442        assert !condition.applies(new Environment(OsmUtils.createPrimitive("way name=fóo")))
     443        condition = getParser("[name =~ /^(?U)(\\p{Lower})+\$/]").condition(Condition.Context.PRIMITIVE)
     444        assert condition.applies(new Environment(OsmUtils.createPrimitive("way name=fóo")))
     445        assert !condition.applies(new Environment(OsmUtils.createPrimitive("way name=fÓo")))
     446    }
    435447}
Note: See TracChangeset for help on using the changeset viewer.