- Timestamp:
- 2014-09-22T22:22:31+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r7357 r7579 67 67 assert css.getErrors().isEmpty() 68 68 def mc1 = new MultiCascade() 69 css.apply(mc1, OsmUtils.createPrimitive("way highway=path"), 1, null,false);69 css.apply(mc1, OsmUtils.createPrimitive("way highway=path"), 1, false); 70 70 assert "green".equals(mc1.getCascade("default").get("text-color", null, String.class)) 71 71 assert "brown".equals(mc1.getCascade("default").get("color", null, String.class)) 72 72 def mc2 = new MultiCascade() 73 css.apply(mc2, OsmUtils.createPrimitive("way highway=residential"), 1, null,false);73 css.apply(mc2, OsmUtils.createPrimitive("way highway=residential"), 1, false); 74 74 assert "orange".equals(mc2.getCascade("default").get("color", null, String.class)) 75 75 assert mc2.getCascade("default").get("text-color", null, String.class) == null 76 76 def mc3 = new MultiCascade() 77 css.apply(mc3, OsmUtils.createPrimitive("way highway=footway"), 1, null,false);77 css.apply(mc3, OsmUtils.createPrimitive("way highway=footway"), 1, false); 78 78 assert ColorHelper.html2color("#FF6644").equals(mc3.getCascade("default").get("color", null, Color.class)) 79 79 } … … 226 226 sheet.loadStyleSource() 227 227 def mc = new MultiCascade() 228 sheet.apply(mc, OsmUtils.createPrimitive("way foo=bar"), 20, null,false)228 sheet.apply(mc, OsmUtils.createPrimitive("way foo=bar"), 20, false) 229 229 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 5 230 sheet.apply(mc, OsmUtils.createPrimitive("way keyA=true"), 20, null,false)230 sheet.apply(mc, OsmUtils.createPrimitive("way keyA=true"), 20, false) 231 231 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 232 sheet.apply(mc, OsmUtils.createPrimitive("way keyB=true"), 20, null,false)232 sheet.apply(mc, OsmUtils.createPrimitive("way keyB=true"), 20, false) 233 233 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 234 sheet.apply(mc, OsmUtils.createPrimitive("way keyA=true keyB=true"), 20, null,false)234 sheet.apply(mc, OsmUtils.createPrimitive("way keyA=true keyB=true"), 20, false) 235 235 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 236 236 } … … 242 242 sheet.loadStyleSource() 243 243 def mc = new MultiCascade() 244 sheet.apply(mc, OsmUtils.createPrimitive("way name=Foo"), 20, null,false)244 sheet.apply(mc, OsmUtils.createPrimitive("way name=Foo"), 20, false) 245 245 assert mc.getCascade(Environment.DEFAULT_LAYER).get("text") == " Foo" 246 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15"), 20, null,false)246 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15"), 20, false) 247 247 assert mc.getCascade(Environment.DEFAULT_LAYER).get("text") == "15 " 248 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15 name=Foo"), 20, null,false)248 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15 name=Foo"), 20, false) 249 249 assert mc.getCascade(Environment.DEFAULT_LAYER).get("text") == "15 Foo" 250 250 … … 252 252 "*[rcn_ref], *[name] {text: join(\" - \", tag(rcn_ref), tag(ref), tag(name)); }") 253 253 sheet.loadStyleSource() 254 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15 ref=1.5 name=Foo"), 20, null,false)254 sheet.apply(mc, OsmUtils.createPrimitive("way rcn_ref=15 ref=1.5 name=Foo"), 20, false) 255 255 assert mc.getCascade(Environment.DEFAULT_LAYER).get("text") == "15 - 1.5 - Foo" 256 256 } … … 358 358 def mc = new MultiCascade() 359 359 360 sheet.apply(mc, OsmUtils.createPrimitive("way x=4 y=6 z=8 u=100"), 20, null,false)360 sheet.apply(mc, OsmUtils.createPrimitive("way x=4 y=6 z=8 u=100"), 20, false) 361 361 assert mc.getCascade(Environment.DEFAULT_LAYER).get("min_value", Float.NaN, Float.class) == 4.0f 362 362 assert mc.getCascade(Environment.DEFAULT_LAYER).get("max_value", Float.NaN, Float.class) == 8.0f 363 363 364 sheet.apply(mc, OsmUtils.createPrimitive("way x=4 y=6 widths=1;2;8;56;3;a"), 20, null,false)364 sheet.apply(mc, OsmUtils.createPrimitive("way x=4 y=6 widths=1;2;8;56;3;a"), 20, false) 365 365 assert mc.getCascade(Environment.DEFAULT_LAYER).get("min_value", -777f, Float.class) == 4 366 366 assert mc.getCascade(Environment.DEFAULT_LAYER).get("max_value", -777f, Float.class) == 6
Note:
See TracChangeset
for help on using the changeset viewer.