Changeset 16950 in josm for trunk/test
- Timestamp:
- 2020-08-28T22:38:19+02:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
r16937 r16950 124 124 @Test 125 125 public void testWayName() { 126 assertEquals("\u2068building\u2069 \u2068(0 nodes)\u2069", 127 getFormattedWayName("building=yes")); 128 assertEquals("\u2068House number 123\u2069 \u2068(0 nodes)\u2069", 129 getFormattedWayName("building=yes addr:housenumber=123")); 130 assertEquals("\u2068House number 123 at FooStreet\u2069 \u2068(0 nodes)\u2069", 131 getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet")); 132 assertEquals("\u2068House FooName\u2069 \u2068(0 nodes)\u2069", 133 getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName")); 126 assertEquals("building (0 nodes)", getFormattedWayName("building=yes")); 127 assertEquals("House number 123 (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123")); 128 assertEquals("House number 123 at FooStreet (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet")); 129 assertEquals("House FooName (0 nodes)", getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName")); 134 130 } 135 131 136 132 static String getFormattedRelationName(String tagsString) { 137 return DefaultNameFormatter.getInstance().format((Relation) OsmUtils.createPrimitive("relation " + tagsString)); 133 return DefaultNameFormatter.getInstance().format((Relation) OsmUtils.createPrimitive("relation " + tagsString)) 134 .replace("\u200E", "").replace("\u200F", ""); 138 135 } 139 136 140 137 static String getFormattedWayName(String tagsString) { 141 return DefaultNameFormatter.getInstance().format((Way) OsmUtils.createPrimitive("way " + tagsString)); 138 return DefaultNameFormatter.getInstance().format((Way) OsmUtils.createPrimitive("way " + tagsString)) 139 .replace("\u200E", "").replace("\u200F", ""); 142 140 } 143 141 … … 152 150 List<Node> nodes = IntStream.rangeClosed(1, 10).mapToObj(i -> new Node(i, 1)) 153 151 .collect(Collectors.toList()); 154 assertEquals("<ul>" + 155 "<li>\u20681\u2069</li>" + 156 "<li>\u20682\u2069</li>" + 157 "<li>\u20683\u2069</li>" + 158 "<li>\u20684\u2069</li>" + 159 "<li>...</li></ul>", 152 assertEquals("<ul><li>1</li><li>2</li><li>3</li><li>4</li><li>...</li></ul>", 160 153 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(nodes, 5)); 161 154 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java
r16947 r16950 33 33 MultipleNameVisitor visitor = new MultipleNameVisitor(); 34 34 visitor.visit(Arrays.asList(new Way(), new Way())); 35 assertEquals("2 ways: \u20680\u2069 \u2068(0 nodes)\u2069, \u20680\u2069 \u2068(0 nodes)\u2069", visitor.toString());35 assertEquals("2 ways: 0 (0 nodes), 0 (0 nodes)", visitor.toString()); 36 36 } 37 37 … … 46 46 TestUtils.newWay("addr:housename=Stark"), 47 47 TestUtils.newRelation("type=route"))); 48 assertEquals("3 objects: \u2068foo\u2069, \u2068House Stark\u2069 \u2068(0 nodes)\u2069, route (0, 0 members)", visitor.toString());48 assertEquals("3 objects: foo, House Stark (0 nodes), route (0, 0 members)", visitor.toString()); 49 49 } 50 50 }
Note:
See TracChangeset
for help on using the changeset viewer.