Changeset 11131 in josm


Ignore:
Timestamp:
2016-10-15T21:17:47+02:00 (8 years ago)
Author:
simon04
Message:

"Missing name:* translation" test: ignore name:etymology:wikidata

Location:
trunk
Files:
2 edited

Legend:

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

    r11129 r11131  
    66
    77import java.util.HashSet;
    8 import java.util.Map.Entry;
    98import java.util.Set;
    109import java.util.regex.Pattern;
     
    6766        Set<String> names = new HashSet<>();
    6867
    69         for (Entry<String, String> entry : p.getKeys().entrySet()) {
    70             if (entry.getKey().startsWith("name:")) {
    71                 String n = entry.getValue();
     68        p.getKeys().forEach((key, n) -> {
     69            if (key.startsWith("name:") && !"name:etymology:wikidata".equals(key)) {
    7270                if (n != null) {
    7371                    names.add(n);
    7472                }
    7573            }
    76         }
     74        });
    7775
    7876        if (names.isEmpty()) return;
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java

    r10945 r11131  
    7777        assertEquals(0, errors.size());
    7878    }
     79
     80    /**
     81     * Test that {@code name:etymology:wikidata} does not count.
     82     */
     83    @Test
     84    public void testEtymologyWikidata() {
     85        final List<TestError> errors = test("node name=Foo name:etymology:wikidata=Bar");
     86        assertEquals(0, errors.size());
     87    }
    7988}
Note: See TracChangeset for help on using the changeset viewer.