Changeset 6859 in josm for trunk/test/unit/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2014-02-17T19:11:05+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r6774 r6859 166 166 167 167 @Test 168 public void testNRegexKeyConditionSelector() throws Exception { 169 def s1 = getParser("*[sport][tourism != hotel]").selector() 170 assert s1.matches(new Environment().withPrimitive(TestUtils.createPrimitive("node sport=foobar"))) 171 assert !s1.matches(new Environment().withPrimitive(TestUtils.createPrimitive("node sport=foobar tourism=hotel"))) 172 def s2 = getParser("*[sport][tourism != hotel][leisure !~ /^(sports_centre|stadium|)\$/]").selector() 173 assert s2.matches(new Environment().withPrimitive(TestUtils.createPrimitive("node sport=foobar"))) 174 assert !s2.matches(new Environment().withPrimitive(TestUtils.createPrimitive("node sport=foobar tourism=hotel"))) 175 assert !s2.matches(new Environment().withPrimitive(TestUtils.createPrimitive("node sport=foobar leisure=stadium"))) 176 } 177 178 @Test 168 179 public void testKeyKeyCondition() throws Exception { 169 180 def c1 = (Condition.KeyValueCondition) getParser("[foo = *bar]").condition(Condition.Context.PRIMITIVE)
Note:
See TracChangeset
for help on using the changeset viewer.