- Timestamp:
- 2015-09-21T20:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy
r8415 r8774 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.mappaint.mapcss; 2 package org.openstreetmap.josm.gui.mappaint.mapcss 3 4 import org.openstreetmap.josm.gui.mappaint.MultiCascade; 3 5 4 6 import static org.junit.Assert.* … … 121 123 public void matches_5() { 122 124 def css = """ 123 way <[role != "my_role"] relation { }125 way <[role != "my_role"] relation {text: index();} 124 126 """ 125 127 ChildOrParentSelector selector = parse(css) … … 139 141 r.addMember(new RelationMember("my_role", w2)) 140 142 r.addMember(new RelationMember("another role", w3)) 143 r.addMember(new RelationMember("yet another role", w3)) 141 144 142 Environment e = new Environment(r )145 Environment e = new Environment(r, new MultiCascade(), Environment.DEFAULT_LAYER, null) 143 146 assert selector.matches(e) 147 148 MapCSSStyleSource source = new MapCSSStyleSource(css) 149 source.loadStyleSource() 150 source.rules[0].declaration.execute(e) 151 assert Float.valueOf(3f).equals(e.getCascade(Environment.DEFAULT_LAYER).get("text", null, Float.class)) 144 152 } 145 153
Note:
See TracChangeset
for help on using the changeset viewer.