Changeset 6554 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2013-12-28T01:31:47+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r6547 r6554 106 106 assert !c1.applies(getEnvironment("lanes:foobar", "3")) 107 107 } 108 109 @Test 110 public void testKeyKeyCondition() throws Exception { 111 def c1 = (Condition.KeyValueCondition) new MapCSSParser(new StringReader("[foo = *bar]")).condition(Condition.Context.PRIMITIVE) 112 def w1 = new Way() 113 w1.put("foo", "123") 114 w1.put("bar", "456") 115 assert !c1.applies(new Environment().withPrimitive(w1)) 116 w1.put("bar", "123") 117 assert c1.applies(new Environment().withPrimitive(w1)) 118 def c2 = (Condition.KeyValueCondition) new MapCSSParser(new StringReader("[foo =~ */bar/]")).condition(Condition.Context.PRIMITIVE) 119 def w2 = new Way(w1) 120 w2.put("bar", "[0-9]{3}") 121 assert c2.applies(new Environment().withPrimitive(w2)) 122 w2.put("bar", "[0-9]") 123 assert c2.applies(new Environment().withPrimitive(w2)) 124 w2.put("bar", "^[0-9]\$") 125 assert !c2.applies(new Environment().withPrimitive(w2)) 126 } 108 127 }
Note:
See TracChangeset
for help on using the changeset viewer.