Changeset 15667 in josm for trunk/test


Ignore:
Timestamp:
2020-01-09T23:42:30+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18455 - smarter error detection, should lead to less false positives

File:
1 edited

Legend:

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

    r15614 r15667  
    336336        assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Hökumət Evi"));
    337337    }
     338
     339    /**
     340     * Detects objects with types not supported by their presets.
     341     * @throws IOException in case of I/O error
     342     */
     343    @Test
     344    public void testObjectTypeNotSupportedByPreset() throws IOException {
     345        List<TestError> errors = test(OsmUtils.createPrimitive("relation waterway=river"));
     346        assertEquals(1, errors.size());
     347        assertEquals(TagChecker.INVALID_PRESETS_TYPE, errors.get(0).getCode());
     348        errors = test(OsmUtils.createPrimitive("relation type=waterway waterway=river"));
     349        assertTrue(errors.toString(), errors.isEmpty());
     350    }
    338351}
Note: See TracChangeset for help on using the changeset viewer.