Changeset 8784 in josm for trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
- Timestamp:
- 2015-09-22T20:37:48+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r8775 r8784 10 10 import org.openstreetmap.josm.data.osm.DataSet 11 11 import org.openstreetmap.josm.data.osm.OsmUtils 12 import org.openstreetmap.josm.data.osm.Node 12 13 import org.openstreetmap.josm.data.osm.Way 13 14 import org.openstreetmap.josm.gui.mappaint.Environment … … 231 232 232 233 @Test 234 public void testParentTag() throws Exception { 235 def c1 = getParser("way[foo] > node[tag(\"foo\")=parent_tag(\"foo\")] {}").child_selector() 236 def ds = new DataSet() 237 def w1 = new Way() 238 def w2 = new Way() 239 def n1 = new Node(new LatLon(1, 1)) 240 def n2 = new Node(new LatLon(2, 2)) 241 w1.put("foo", "123") 242 w2.put("foo", "123") 243 n1.put("foo", "123") 244 n2.put("foo", "0") 245 ds.addPrimitive(w1) 246 ds.addPrimitive(n1) 247 ds.addPrimitive(n2) 248 w1.addNode(n1) 249 w2.addNode(n2) 250 assert c1.matches(new Environment(n1)) 251 assert !c1.matches(new Environment(n2)) 252 assert !c1.matches(new Environment(w1)) 253 assert !c1.matches(new Environment(w2)) 254 n1.put("foo", "0") 255 assert !c1.matches(new Environment(n1)) 256 n1.put("foo", "123") 257 assert c1.matches(new Environment(n1)) 258 } 259 260 @Test 233 261 public void testTicket8568() throws Exception { 234 262 def sheet = new MapCSSStyleSource("" +
Note:
See TracChangeset
for help on using the changeset viewer.