Ignore:
Timestamp:
2020-02-24T21:48:16+01:00 (4 years ago)
Author:
simon04
Message:

fix #18759 - AssertionError on invalid MapCSS zoom range

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java

    r15735 r15925  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertFalse;
     6import static org.junit.Assert.assertNotNull;
    67import static org.junit.Assert.assertNull;
    78import static org.junit.Assert.assertTrue;
     
    626627        assertTrue(sheet.getErrors().toString(), sheet.getErrors().isEmpty());
    627628    }
     629
     630    /**
     631     * Test parsing zoom expressions
     632     * @throws ParseException if a parsing error occurs
     633     */
     634    @Test
     635    public void testZoom() throws ParseException {
     636        assertNotNull(getParser("|z12").zoom());
     637        assertNotNull(getParser("|z12-").zoom());
     638        assertNotNull(getParser("|z-12").zoom());
     639        assertNotNull(getParser("|z12-16").zoom());
     640    }
     641
     642    /**
     643     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18759">Bug #18759</a>.
     644     * @throws ParseException if a parsing error occurs
     645     */
     646    @Test(expected = IllegalArgumentException.class)
     647    public void testZoomIAE() throws ParseException {
     648        assertNotNull(getParser("|z16-15").zoom());
     649    }
    628650}
Note: See TracChangeset for help on using the changeset viewer.