Changeset 16296 in josm for trunk/test


Ignore:
Timestamp:
2020-04-14T07:14:38+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19053:Validator does not find overlapping buildings anymore

  • improve handling of ignore action for messages produced by MapCSSTagCheckerTest. This requires a change in the entries stored in preferences.xml.
  • partly revert r16247 to re-enable ignore button for groups
  • add code to recognize and remove ignore list entries produced with older version of JOSM. Users have to re-add those items by ignoring the errors again.
File:
1 edited

Legend:

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

    r16033 r16296  
    145145        assertEquals(1, errors.size());
    146146        assertEquals("has alt_name but not name", errors.iterator().next().getMessage());
    147         assertEquals("3000_*[.+_name][!name]", errors.iterator().next().getIgnoreSubGroup());
     147        assertEquals("3000_has alt_name but not name", errors.iterator().next().getIgnoreSubGroup());
    148148    }
    149149
     
    160160        assertEquals(1, errors.size());
    161161        assertEquals("footway used with foot=no", errors.iterator().next().getMessage());
    162         assertEquals("3000_way[highway=footway][foot]", errors.iterator().next().getIgnoreSubGroup());
     162        assertEquals("3000_footway used with foot=no", errors.iterator().next().getIgnoreSubGroup());
    163163    }
    164164
     
    414414    }
    415415
     416    /**
     417     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19053">Bug #19053</a>.
     418     * Mapcss rule with group.
     419     * @throws ParseException if a parsing error occurs
     420     */
     421    @Test
     422    public void testTicket19053() throws ParseException {
     423        final MapCSSTagChecker test = buildTagChecker(
     424                "*[ele][ele =~ /^-?[0-9]+\\.[0-9][0-9][0-9]+$/] {"
     425                        + "throwWarning: tr(\"{0}\",\"{0.tag}\");"
     426                        + "group: tr(\"Unnecessary amount of decimal places\");" + "}");
     427        final OsmPrimitive p = OsmUtils.createPrimitive("node ele=12.123456");
     428        final Collection<TestError> errors = test.getErrorsForPrimitive(p, false);
     429        assertEquals(1, errors.size());
     430        assertEquals("Unnecessary amount of decimal places", errors.iterator().next().getMessage());
     431        assertEquals("3000_ele=12.123456", errors.iterator().next().getIgnoreSubGroup());
     432        assertEquals("3000_Unnecessary amount of decimal places", errors.iterator().next().getIgnoreGroup());
     433    }
     434
    416435}
Note: See TracChangeset for help on using the changeset viewer.