Ignore:
Timestamp:
2019-01-13T17:24:13+01:00 (6 years ago)
Author:
GerdP
Message:

fix #17199

  • Don't suggest different spelling when all preset values for a key are numerical
  • Add layer to ignore list, is checked in MapCSSTagChecker
  • Add start_date end end_date to ignore list
  • apply modified version of 17055-use-ignore.patch: + the lines from ignoretags.cfg starting with K: are treated as "often used". + instead of "... is not in the presets ..." use "... is unknown ..." in messages
File:
1 edited

Legend:

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

    r14585 r14696  
    105105        final List<TestError> errors = test(OsmUtils.createPrimitive("node landuse=forrest"));
    106106        assertEquals(1, errors.size());
    107         assertEquals("Misspelled property value", errors.get(0).getMessage());
    108         assertEquals("Value 'forrest' for key 'landuse' looks like 'forest'.", errors.get(0).getDescription());
     107        assertEquals("Unknown property value", errors.get(0).getMessage());
     108        assertEquals("Value 'forrest' for key 'landuse' is unknown, maybe 'forest' is meant?", errors.get(0).getDescription());
    109109        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
    110110        assertFalse(errors.get(0).isFixable());
     
    119119        final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=servics"));
    120120        assertEquals(1, errors.size());
    121         assertEquals("Misspelled property value", errors.get(0).getMessage());
    122         assertEquals("Value 'servics' for key 'highway' looks like one of [service, services].", errors.get(0).getDescription());
     121        assertEquals("Unknown property value", errors.get(0).getMessage());
     122        assertEquals(
     123                "Value 'servics' for key 'highway' is unknown, maybe one of [service, services] is meant?",
     124                errors.get(0).getDescription());
    123125        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
    124126        assertFalse(errors.get(0).isFixable());
     
    133135        final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=residentail"));
    134136        assertEquals(1, errors.size());
    135         assertEquals("Misspelled property value", errors.get(0).getMessage());
    136         assertEquals("Value 'residentail' for key 'highway' looks like 'residential'.", errors.get(0).getDescription());
    137         assertEquals(Severity.WARNING, errors.get(0).getSeverity());
    138         assertFalse(errors.get(0).isFixable());
    139     }
    140 
    141     /**
    142      * Check for misspelled value.
    143      * @throws IOException if any I/O error occurs
    144      */
    145     @Test
    146     public void testShortValNotInPreset() throws IOException {
    147         final List<TestError> errors = test(OsmUtils.createPrimitive("node layer=6"));
    148         assertEquals(1, errors.size());
    149         assertEquals("Presets do not contain property value", errors.get(0).getMessage());
    150         assertEquals("Value '6' for key 'layer' not in presets.", errors.get(0).getDescription());
    151         assertEquals(Severity.OTHER, errors.get(0).getSeverity());
     137        assertEquals("Unknown property value", errors.get(0).getMessage());
     138        assertEquals("Value 'residentail' for key 'highway' is unknown, maybe 'residential' is meant?",
     139                errors.get(0).getDescription());
     140        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
    152141        assertFalse(errors.get(0).isFixable());
    153142    }
     
    205194        final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=Residential"));
    206195        assertEquals(1, errors.size());
    207         assertEquals("Misspelled property value", errors.get(0).getMessage());
    208         assertEquals("Value 'Residential' for key 'highway' looks like 'residential'.", errors.get(0).getDescription());
     196        assertEquals("Unknown property value", errors.get(0).getMessage());
     197        assertEquals("Value 'Residential' for key 'highway' is unknown, maybe 'residential' is meant?",
     198                errors.get(0).getDescription());
    209199        assertEquals(Severity.WARNING, errors.get(0).getSeverity());
    210200        assertFalse(errors.get(0).isFixable());
Note: See TracChangeset for help on using the changeset viewer.