Changeset 9247 in josm for trunk/test


Ignore:
Timestamp:
2016-01-01T22:34:11+01:00 (5 years ago)
Author:
simon04
Message:

fix #12267 - MapCSS conditions does not handle unquoted 0 value

Such as in [frequency=0].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy

    r9214 r9247  
    101101        assert selNeg.matches(new Environment(OsmUtils.createPrimitive("way foo=bar src=1,2")))
    102102    }
     103
     104    @Test
     105    public void testValueFive() throws Exception {
     106        // ticket #5985
     107        def sel = new MapCSSParser(new StringReader("*[width=5]")).selector()
     108        assert sel.matches(new Environment(OsmUtils.createPrimitive("way highway=track width=5")))
     109        assert !sel.matches(new Environment(OsmUtils.createPrimitive("way highway=track width=2")))
     110    }
     111
     112    @Test
     113    public void testValueZero() throws Exception {
     114        // ticket #12267
     115        def sel = new MapCSSParser(new StringReader("*[frequency=0]")).selector()
     116        assert sel.matches(new Environment(OsmUtils.createPrimitive("way railway=rail frequency=0")))
     117        assert !sel.matches(new Environment(OsmUtils.createPrimitive("way railway=rail frequency=50")))
     118    }
    103119}
Note: See TracChangeset for help on using the changeset viewer.