Changeset 15042 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r14991 r15042 422 422 } 423 423 424 privatestatic boolean containsUnusualUnicodeCharacter(String key, String value) {424 static boolean containsUnusualUnicodeCharacter(String key, String value) { 425 425 return value != null && value.chars().anyMatch(c -> isUnusualUnicodeBlock(key, UnicodeBlock.of(c))); 426 426 } … … 446 446 // CHECKSTYLE.OFF: BooleanExpressionComplexity 447 447 return b == UnicodeBlock.COMBINING_MARKS_FOR_SYMBOLS // U+20D0..U+20FF 448 || b == UnicodeBlock.ARROWS // U+2190..U+21FF449 448 || b == UnicodeBlock.MATHEMATICAL_OPERATORS // U+2200..U+22FF 450 449 || b == UnicodeBlock.ENCLOSED_ALPHANUMERICS // U+2460..U+24FF -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
r14991 r15042 250 250 } 251 251 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 */ 252 258 private static void doTestUnwantedNonprintingControlCharacters(String s, Consumer<Boolean> assertionC, String expected) { 253 259 assertionC.accept(TagChecker.containsUnwantedNonPrintingControlCharacter(s)); … … 296 302 } 297 303 } 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 } 298 317 }
Note:
See TracChangeset
for help on using the changeset viewer.