Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/Lanes.java
r6606 r6647 31 31 32 32 static int getLanesCount(String value) { 33 return value.isEmpty() ? 0 : value. split("\\|").length;33 return value.isEmpty() ? 0 : value.replaceAll("[^|]", "").length() + 1; 34 34 } 35 35 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.groovy
r6606 r6647 18 18 assert lanes.getLanesCount("left|right") == 2 19 19 assert lanes.getLanesCount("yes|no|yes") == 3 20 assert lanes.getLanesCount("yes||") == 3 20 21 } 21 22 … … 54 55 assert lanes.errors.get(0).getMessage() == "Number of lanes:forward+lanes:backward greater than lanes" 55 56 } 57 58 void test8() { 59 lanes.check(TestUtils.createPrimitive("way destination:country:lanes=X|Y;Z|none destination:ref:lanes=xyz|| destination:sign:lanes=none|airport|none")) 60 assert lanes.errors.isEmpty() 61 } 56 62 }
Note:
See TracChangeset
for help on using the changeset viewer.