Changeset 16950 in josm for trunk/test


Ignore:
Timestamp:
2020-08-28T22:38:19+02:00 (4 years ago)
Author:
simon04
Message:

Revert "fix #19717 - DefaultNameFormatter: use FIRST-STRONG ISOLATE for bidirectional texts"

This reverts commit r16937

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  
    124124    @Test
    125125    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"));
    134130    }
    135131
    136132    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", "");
    138135    }
    139136
    140137    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", "");
    142140    }
    143141
     
    152150        List<Node> nodes = IntStream.rangeClosed(1, 10).mapToObj(i -> new Node(i, 1))
    153151                .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>",
    160153                DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(nodes, 5));
    161154    }
  • trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java

    r16947 r16950  
    3333        MultipleNameVisitor visitor = new MultipleNameVisitor();
    3434        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());
    3636    }
    3737
     
    4646                TestUtils.newWay("addr:housename=Stark"),
    4747                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());
    4949    }
    5050}
Note: See TracChangeset for help on using the changeset viewer.