Changeset 14897 in josm for trunk/test


Ignore:
Timestamp:
2019-03-18T09:10:55+01:00 (5 years ago)
Author:
GerdP
Message:

fix #17468: Validator produces wrong warning for misspelled tag key

TODO: further improve words.cfg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java

    r14732 r14897  
    8484
    8585    /**
     86     * Check for misspelled key where the suggested alternative is given with prefix E: in ignoreTags.cfg.
     87     * The error should be fixable.
     88     * @throws IOException if any I/O error occurs
     89     */
     90    @Test
     91    public void testUpperCaseIgnoredKey() throws IOException {
     92        // ticket 17468
     93        final List<TestError> errors = test(OsmUtils.createPrimitive("node wheelchair:Description=bla"));
     94        assertEquals(1, errors.size());
     95        assertEquals("Misspelled property key", errors.get(0).getMessage());
     96        assertEquals("Key 'wheelchair:Description' looks like 'wheelchair:description'.", errors.get(0).getDescription());
     97        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
     98        assertTrue(errors.get(0).isFixable());
     99    }
     100
     101    /**
     102     * Check for misspelled key where the suggested alternative is given with prefix K: in ignoreTags.cfg.
     103     * The error should be fixable.
     104     * @throws IOException if any I/O error occurs
     105     */
     106    @Test
     107    public void testUpperCaseInKeyIgnoredTag() throws IOException {
     108        // ticket 17468
     109        final List<TestError> errors = test(OsmUtils.createPrimitive("node land_Area=administrative"));
     110        assertEquals(1, errors.size());
     111        assertEquals("Misspelled property key", errors.get(0).getMessage());
     112        assertEquals("Key 'land_Area' looks like 'land_area'.", errors.get(0).getDescription());
     113        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
     114        assertTrue(errors.get(0).isFixable());
     115    }
     116
     117    /**
    86118     * Check for unknown key.
    87119     * @throws IOException if any I/O error occurs
Note: See TracChangeset for help on using the changeset viewer.