Changeset 15042 in josm


Ignore:
Timestamp:
2019-05-03T15:38:44+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #17667 - allow arrows, several valid use cases in transport

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r14991 r15042  
    422422    }
    423423
    424     private static boolean containsUnusualUnicodeCharacter(String key, String value) {
     424    static boolean containsUnusualUnicodeCharacter(String key, String value) {
    425425        return value != null && value.chars().anyMatch(c -> isUnusualUnicodeBlock(key, UnicodeBlock.of(c)));
    426426    }
     
    446446        // CHECKSTYLE.OFF: BooleanExpressionComplexity
    447447        return b == UnicodeBlock.COMBINING_MARKS_FOR_SYMBOLS            // U+20D0..U+20FF
    448             || b == UnicodeBlock.ARROWS                                 // U+2190..U+21FF
    449448            || b == UnicodeBlock.MATHEMATICAL_OPERATORS                 // U+2200..U+22FF
    450449            || b == UnicodeBlock.ENCLOSED_ALPHANUMERICS                 // U+2460..U+24FF
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java

    r14991 r15042  
    250250    }
    251251
     252    /**
     253     * Checks for unwanted non printing control characters
     254     * @param s String to test
     255     * @param assertionC assertion on the result (true/false)
     256     * @param expected expected fixed value
     257     */
    252258    private static void doTestUnwantedNonprintingControlCharacters(String s, Consumer<Boolean> assertionC, String expected) {
    253259        assertionC.accept(TagChecker.containsUnwantedNonPrintingControlCharacter(s));
     
    296302        }
    297303    }
     304
     305    /**
     306     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17667">Bug #17667</a>.
     307     */
     308    @Test
     309    public void testTicket17667() {
     310        assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Bus 118: Berlin, Rathaus Zehlendorf => Potsdam, Drewitz Stern-Center"));
     311        assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Καρδίτσα → Λάρισα"));
     312        assertFalse(TagChecker.containsUnusualUnicodeCharacter("traffic_sign", "FI:871[← Lippuautomaatti]"));
     313        assertFalse(TagChecker.containsUnusualUnicodeCharacter("traffic_sign", "FI:871[↑ Nostopaikka ↑]"));
     314        assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Cinderella II - Strandvägen ↔ Hagede"));
     315        assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Tallinn — Narva"));
     316    }
    298317}
Note: See TracChangeset for help on using the changeset viewer.